LanguageEnvironment

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

LanguageEnvironment

Eliot Miranda-2
Hi All,

    in reviewing the tests given recent work leading up to the 5.2 release I see an error in LangEnvBugs>>testIsFontAvailable.

This is the phrase:

    (LanguageEnvironment localeID: 'en' ) isFontAvailable

But LanguageEnvironment class>>#localeID: expects a LocaleID as argument.  So is the fix to rewrite the test to use

    (LanguageEnvironment localeID: (LocaleID isoLanguage: 'en')) isFontAvailable

or to be more friendly:

localeID: localeIDOrISONameString

"LanguageEnvironment localeID: (LocaleID isoString: 'ja-kid')"
"LanguageEnvironment localeID: (LocaleID isoString: 'xx')"
localeIDOrISOName isString ifTrue:
[^self  localeID: (LocaleID isoLanguage: localeIDOrISOName)].
^ self knownEnvironments
at: localeIDOrISONameString
ifAbsent: [localeIDOrISONameString hasParent
ifTrue: [self knownEnvironments
at: localeIDOrISONameString parent
ifAbsent: [self localeID: 'en']]
ifFalse: [self localeID: 'en']]

?


And given that
    self ensureInternetConnectionTo: 'http://metatoys.org/pub/'.
fails and
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="https://www.hugedomains.com/domain_profile.cfm?d=metatoys&amp;e=com">here</a>.</h2>
</body></html>

shouldn't LocaleTest>>#testIsFontAvailable be n expected failure?

_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

Re: LanguageEnvironment

Levente Uzonyi
On Wed, 13 Jun 2018, Eliot Miranda wrote:

> Hi All,
>     in reviewing the tests given recent work leading up to the 5.2 release I see an error in LangEnvBugs>>testIsFontAvailable.
>
> This is the phrase:
>
>     (LanguageEnvironment localeID: 'en' ) isFontAvailable
>
> But LanguageEnvironment class>>#localeID: expects a LocaleID as argument.  So is the fix to rewrite the test to use
>
>     (LanguageEnvironment localeID: (LocaleID isoLanguage: 'en')) isFontAvailable
>
> or to be more friendly:
>
> localeID: localeIDOrISONameString
>
> "LanguageEnvironment localeID: (LocaleID isoString: 'ja-kid')"
> "LanguageEnvironment localeID: (LocaleID isoString: 'xx')"
> localeIDOrISOName isString ifTrue:
> [^self  localeID: (LocaleID isoLanguage: localeIDOrISOName)].
> ^ self knownEnvironments
> at: localeIDOrISONameString
> ifAbsent: [localeIDOrISONameString hasParent
> ifTrue: [self knownEnvironments
> at: localeIDOrISONameString parent
> ifAbsent: [self localeID: 'en']]
> ifFalse: [self localeID: 'en']]
>
> ?
Sounds good.

>
>
> And given that
>     self ensureInternetConnectionTo: 'http://metatoys.org/pub/'.
> fails and
> curl http://metatoys.com/pub
> <html><head><title>Object moved</title></head><body>
> <h2>Object moved to <a href="https://www.hugedomains.com/domain_profile.cfm?d=metatoys&amp;e=com">here</a>.</h2>
> </body></html>
>
> shouldn't LocaleTest>>#testIsFontAvailable be n expected failure?
It should. Here is our previous discussion about this test case:
http://forum.world.st/LocaleTest-testIsFontAVailable-td4939155.html

Levente

>
> _,,,^..^,,,_
> best, Eliot
>
>

Reply | Threaded
Open this post in threaded view
|

Re: LanguageEnvironment

Tim Johnson-2
In reply to this post by Eliot Miranda-2
Hi Eliot,

On Jun 13, 2018, at 9:49 AM, Eliot Miranda wrote:

Hi All,

    in reviewing the tests given recent work leading up to the 5.2 release I see an error in LangEnvBugs>>testIsFontAvailable.


Thanks for bringing this up.  I noticed this one too and spent an hour or two working on it but never sent along my changes... maybe because I had some of the same questions.

This is the phrase:

    (LanguageEnvironment localeID: 'en' ) isFontAvailable

But LanguageEnvironment class>>#localeID: expects a LocaleID as argument.  So is the fix to rewrite the test to use

[...]

?

Yes, I think so.  That meshes with the other users of this system within the image.

And given that
    self ensureInternetConnectionTo: 'http://metatoys.org/pub/'.
fails and
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="https://www.hugedomains.com/domain_profile.cfm?d=metatoys&amp;e=com">here</a>.</h2>
</body></html>

shouldn't LocaleTest>>#testIsFontAvailable be n expected failure?

Good call.  It seems that without this URL being live on the internet, the remote-font-loading-for-locale-switching won't work (Locale class>>#switchAndInstallFontToID:gently:)


...or provide the necessary files on files.squeak.org.

We can also rewrite the test so it does not hardcode the URL but rather takes its URL from LanguageEnvironment>>#fontDownloadUrls 

However, I have to ask:  was this remote-font-loading system affected by the font system refurbishment during the Squeak license change?  Is this remote-font-loading-for-locale-switching system still relevant?

Thanks,
Tim





Reply | Threaded
Open this post in threaded view
|

Re: LanguageEnvironment

Tim Johnson-2

On Jun 17, 2018, at 9:48 AM, Tim Johnson wrote:

> Good call.  It seems that without this URL being live on the internet, the remote-font-loading-for-locale-switching won't work (Locale class>>#switchAndInstallFontToID:gently:)
>
> We can change the URL to https://web.archive.org/web/20161219105306/http://metatoys.org:80/pub/
>
> ...or provide the necessary files on files.squeak.org.
>
> We can also rewrite the test so it does not hardcode the URL but rather takes its URL from LanguageEnvironment>>#fontDownloadUrls
>
> However, I have to ask:  was this remote-font-loading system affected by the font system refurbishment during the Squeak license change?  Is this remote-font-loading-for-locale-switching system still relevant?

Replying to myself:  I see Eliot's concerns were addressed in The Trunk: Tests-ul.398.mcz.  Thanks to Levente Uzonyi.

I still wonder about the viability of the remote font loading system for locales, and my questions above.

Thanks,
Tim