I have created a Resource File as App.rrc(Root)and App_fr.rrc under App.rrh(header file) and have added two keys - value pair to it.
Now when i extract values in using object of resource i get only the values from App.rrc files but not from App_fr.rrc
What should i do?
You have to set the Locale to french using the following code
Locale.setDefault(Locale.get(Locale.LOCALE_fr, null));
Related
In my framework app, I have some localization files added and have a method to get
localised strings as follow
-(NSString *)getCurrentLocale{
return NSLocalizedString(#"mykey", nil);
}
and I have installed this pod into one demo app, and trying to get the locale but it always returns the key, (it returns 'mykey')
I have double checked the format and name (Localizable.strings) within the string files
all files has proper format
but I do have locale strings as values in my Localizable.strings
ex: "mykey" = "ar_SA";
any Idea where I am going wrong?
Usually, this happens when you don't have the Localizable.strings file in the appropriate language folder (e.g. de.lproj). Also, ensure you haven't put your Localizable.strings file in the Base.lproj folder, as the same problem will occur.
To summarize, make sure your project Localizations have their Localizable.strings files in their respective language folders to provide the correct translations.
Finally, if the above are true (and this may be obvious), the device must have its locale set to actually pull strings from a given language.
Reference: Internationalization and Localization Guide
I need to access a local JSON file. Since Grails 2.4 implements the AssetPipeline plugin by default, I saved my local JSON file at:
/grails-app/assets/javascript/vendor/me/json/local.json
Now what I need is to generate a URL to this JSON file, to be used as a function parameter on my JavaScript's $.getJSON() . I've tried using:
var URL.local = ""${ raw(asset.assetPath(src: "local.json")) }";
but it generates an invalid link:
console.log(URL.local);
// prints /project/assets/local.json
// instead of /project/assets/vendor/me/json/local.json
I also encountered the same scenario with images that are handled by AssetPipeline1.9.9— that are supposed to be inserted dynamically on the page. How can I generate the URL pointing this resource? I know, I can always provide a static String for the URL, but it seems there would be a more proper solution.
EDIT
I was asked if I could move the local JSON file directly under the assets/javascript root directory instead of placing it under a subdirectory to for an easier solution. I prefer not to, for organization purposes.
Have you tried asset.assetPath(src: "/me/json/local.json")
The assets plugin looks in all of the immediate children of assets/. Your local.json file would need to be placed in /project/assets/foo/ for your current code to pick it up.
Check out the relevant documentation here which contains an example.
The first level deep within the assets folder is simply used for organization purposes and can contain folders of any name you wish. File types also don't need to be in any specific folder. These folders are omitted from the URL mappings and relative path calculations.
I have an input KSDS file, i am using emp-id as primary key and emp-dept as alternate key, with access mode as dynamic. I am reading the file using dynamic access base upon the alternate key, in runjcl i am using base ksds file and ksds path file, so normally cobol will read from the path file
(which is sorted based upon the alternate key not the primary key).
but problem is while i am writing to an output ksds it is showing file status 21 error, because
in ksds record can only be inserted if it is sorted based upon the primary key, so what to do? is there any other alternate method??
Why not
Write the output to a normal Sequential file
Sort copy the sequential file into the output VSAM file.
If updating an existing file, you should be able to update the file. Alternatively you can always use 2 programs and sort the output from the first program.
Does the output file really need to be a VSAM file ???.
Is there any way in action script to list all the keys (not values) of given resource bundle.
My use case is to combine content of two different resource bundle. I wan to do this by creating a new resource bundle at runtime and add each key value pair from two different resource bundles into one. I would appreciate if anyone have idea if it can be done different way.
If you get the actual resource bundle (eg. IResourceBundle), you could iterate over the name keys in the content object I would think.
I am creating a resource file using
ResourceBundle _resources = ResourceBundle.getBundle(BUNDLE_ID, BUNDLE_NAME);
Now i want to create another Resource file in that same class.
Can i do it in the same way like for first Resource file ?
The interface ResourceFile.java is an auto-generated file. Then how to view it ?
You need to edit the resource file (ResourceFile.rrc) in the BlackBerry JDE directly - from there you can add new key/value pairs. I don't think there's a way to iterate through all available keys in the code.