SmartZoos / Toolset

Gaming platform for SmartZoos project
MIT License
0 stars 1 forks source link

Un-resourced string #226

Closed kaimikael closed 6 years ago

kaimikael commented 6 years ago

I noticed that when creating an activity, the language choices are all in English, even if I have Swedish as the browser. See attached screen shot. I expected the menu would use the language strings in 'languages' in resources/lang/sv/general.php.

screenshot_2018-04-20-14-45-47

pjotrsavitski commented 6 years ago

This is because "language select" and "system language select" use the same translations. Try switching to "Estonian".

If all the language names are translated, then it should work as expected.

kaimikael commented 6 years ago

Do I understand you correctly that this set of language strings comes from the phone OS and is not anything we can affect?

pjotrsavitski commented 6 years ago

No, that is because of translation file contents. Compare those:

https://github.com/SmartZoos/Toolset/blob/master/resources/lang/et/general.php#L25 https://github.com/SmartZoos/Toolset/blob/master/resources/lang/sv/general.php#L25

Estonian has translations for all the languages, swedish one has texts (translations) in native languages. Language select (input element within a form) and platform interface language select both use the same place from translation file. This is why you get that kind of result.

kaimikael commented 6 years ago

? No, I don't understand at all now. The Swedish resource file says 'languages' => [ 'en' => 'English', 'et' => 'Eesti keel', 'ru' => 'По-русски', 'fi' => 'Suomi', 'sv' => 'Svenska', ],

so I expected the ”Språk” menu above to show “Svenska”, not “Swedish”.

pjotrsavitski commented 6 years ago

Well, that is strange. I just switched language to swedish an visited the same page. It had what you would have expected.

The language option did not come from the browser setting, I switched manually. But that should have no difference what so ever.

kaimikael commented 6 years ago

How interesting. Hm. Maybe it does have something with the OS to do, because I set the browser language settings to Swedish, but the rest of the phone still speaks English.

kaimikael commented 6 years ago

This is in Chrome on an Android, just to be clear.

pjotrsavitski commented 6 years ago

I could check it out later, with system setting the language, not manual select. See what I get, but I have doubts it would matter.

Maybe something is tying to translate the page, at least partially. But this one is just a wild guess.

The translation system is the same for all the interface. Thus, it should not be different at all.

pjotrsavitski commented 6 years ago

Well, I have a few emulators running through the VM. See if I can check that out next week.

If that one is impossible, then I would have to switch language on my own phone and see what I get. But that is something that should not be happening, unless something changed the texts for the "select input".

pjotrsavitski commented 6 years ago

It is a bug, have finally identified it. The issue only appears when the local is detected automatically. Language options logic is used for determining the language. But that is loaded/initialised before the language is set.

Will provide a fix soon.