I have a question regarding "adding a new language" properties-file in Grails.
I tried to add a new file containing a language that wasn't put in by default - in this case I just took a language - no norwegian - and added a file named messages_no.properties to the i18n-folder but it won't show when I change my computer's language.
For example, Swedish se is in by default and it just works.
Am I missing anything?
Related
I've been searching all over the internet and there doesn't seem to be a clear explanation on how to localize strings using SpriteKit. Only seeing tutorials for people using the interface builder, but all I really want is, imagine this:
I have an SKLabelNode called label. And I define the text like:
labl.text = NSLocalizedString("titleOfTheScreen",nil)
So basically what I think I have to do is add the new language in the Project settings. Then, I add a new Strings file called Localized, and add it to the new folder.
But what happens to my English language? There's no file for the original one
First you have to add a Strings File:
Then open the project settings and add a new language:
Mark your added strings file as target:
Find the newly added localising file. (English is automatically added)
From your screenshots I can see that you have "File.strings" file. You should have created "Localizable.strings" file.
Also, I can see that you have the (Base), (English) and (German) strings version. Why do you think English is not there?
In each of the files you should put strings like that:
"titleOfTheScreen" = "blah-blah";
Replace "blah-blah" with the proper translation in each of the strings files. It's important to note that the semi-colon at the end of the lines in strings files are mandatory, otherwise Xcode would issue some really funny error messages. This is easy to overlook if you're programming in Swift and trailing semi-colons are not mandatory.
We are facing a strange behaviour with the handling of NSLoaclizedString with our bundle strings file.
We have maintained our strings file in:
de_AT (german in Austria)
de_DE (german in Germany)
We didn't setup any base/default strings file since we usually wan't to define per region which strings file should be used. So
Region Poland should use de_DE
Region Italy should use de_AT
During our tests we just recognized that NSLocalizedString just takes the first bundle (de_AT) independant of any Locale if the locale doesn't match.
Is there any way to define/control for which Locale we want to see the translations?
We only found a parameter "tableName" for the language, but no language & country specific locale... we don't want to create Localizable.strings for every available combination of language & country.
Thanks!
Ok we researched a lot, our current solution is to create independant Localizable.strings file and name them per locale:
de_AT.strings
de_DE.strings
Based on our mapping logic we do then set the right bundleName...
I have added a new column in the Order Search result by customizing the "Order_OrderSearchResult_CockpitGroup.xml" and adding its entry in "projectdata_cscockpit_ui_components.impex". I added the property value in both English and Japanese locale property files.
I ran the impex file again in HAC, then did a hybris update by selecting cscockpit and after that reset the user setting in cockpit menu. But I'm only able to see the English locale property and not the Japanese locale property while logging through Japanese locale.
Am I missing something?
Many thanks!
You have to add the label in i3-label_{lang code}.properties file?
I tried by adding the same Japanese property to both i3-label_en.properties and i3-label_ja.properties file by using normal characters as well as unicode but it was not reflecting even after hybris update and resetting personal settings in cockpit.
I resolved this issue by adding the Japanese property in unicode in the customized cockpit locales_en.properties and locales_ja.properties file. Since our website is not using English characters, so I had to add same Japanese property in both files. Not the best way, but yes this workaround worked for me.
I am attempting to use InAppSettingsKit to manage my settings. This uses the Settings.bundle with a .plist file and the .strings files for each of the languages being translated.
I can confirm that the translation of my strings is working properly outside of my application, using the Setting application. But when I am in my application, the translation is not occurring.
I think it comes down to code like this, from the InAppSettingsKit class IASKSettingsReader, with a couple logging statements that I thought my be helpful:
- (NSString*)titleForStringId:(NSString*)stringId {
NSLog(#"%#",[_bundle localizedStringForKey:stringId value:stringId table:self.localizationTable]);
NSLog(#"%#",[_bundle localizedInfoDictionary]);
return [_bundle localizedStringForKey:stringId value:stringId table:self.localizationTable];
}
If I understand correctly, this should be using a table with the name self.localizationTable as the source of the translation. This value is simply "Root". It's not a path to the Root.strings file in the selected language, so I am guessing that the method localizedStringForKey:value:table: must be using some global system reference that points to the correct path.
I have confirmed that the strings file name is "Root.strings" all around, with a capital R, including in the Root.plist file.
[_bundle localizedInfoDictionary] returns (null); It is doing this for two language settings of English and French.
I'm not sure how to debug this. Thanks for any help you can give.
I'm using InAppSettingsKit with localized text with no problems. Two things I can think of that you could check: are your Root.strings files located in the correct subdirectories of Settings.bundle (en.lproj and fr.lproj for English and French?
Is there a "Strings Filename" entry in your Root.plist? It should simply contain a string with value "Root"
It has been quite some time since I resolved this, and at the time, I didn't fully understand it. But, in the interest of closing out this question, I'll point to the following documentation for future reference:
NSBundle Class Reference
which refers to the following:
Resource Programming Guide
In the second document, refer to the section "String REsources -> Loading String Resources Into Your Code"
The solution contains a properly configured Root.strings file, which shows up in the file list like this:
In a tutorial on setting up internationalization and localization, "Kohana 2.4 I18N (internationalization and localization) Library" the author says:
I'd put it in a Base Controller so that all Controllers inherit it.
This is the code:
I18n::set_locale('tl_PH');
I tried placing it in all the controller and places I could but is not working.
Where is the exact place in Kohana 3.0.4.2 that I should place it?
Put this line in bootstrap.php:
I18n::lang('tl-PH');
The I18n::set_locale function doesn't exist in Kohana 3. See I18n class docs.
Not sure who wrote that article, but locale should be set using the config locale.php config file. You may have to copy it from system/config/locale.php into your application/config/locale.php and set the proper values.
Calling I18n::set_locale() should only happen if you need to change from the default (set in locale.php) to something different (like Dutch, English, etc...).
P.S I'm a Kohana 2.4 core dev...
If you want to set the PHP locale, you will change this is in application/bootstrap.php, there is a setlocale(LC_ALL, 'en_US.utf-8') line there already which you can change to the correct language.
To set Kohana's internal language for translation, add a call to I18n::lang('en-us') (replace "en-us" with your language) after the Kohana::init() call, before Route::set().