How to check whether properties existed in an object and a problem of localization

Former Member
Former Member
I have authored a data field for Edge devices.

Problem 2:
I have created some application settings which can be set by Connect mobile app or GarminExpress PC software.

Also, I defined some labels and used in Data Fields.

Recently I want to localize it with S-Chinese.

What I have done is:
1. Modify Mainfest.xml for Language tag, adding eng and chs into that;
2. Create sub folder named resources-chs;
3. Create a strings.xml file under resources-chs;
4. Copy all items from english default resources into strings.xml.

I can see localized content from simulator. Both of configuration titles and DataFields labels work fine.
But after I publish my Data Fields onto CIQ platform and install my DataFields offcially, NO Chinese displayed on configurations titles also no Chinese in DataFields.
And when I export my app, I have already picked both English and Simplified Chinese.

Additionally,both Connect mobile App and Edge devices already set to Chinese.
And, I references Strings sample app, also tried use "resources.xml" as default resources file, or use "strings.xml" as default string resorces, both of them not works.


Any one knows what the magic on this area?
So many thanks for your helps.
  • Just like "has". But "has" can only check for modules.

    Yes, you can use has to detect if a symbol exists in a class or a module. It is documented in the programmer's guide here...

    The has operator lets you check if a given object has a symbol, which may be a public method, instance variable, or even a class definition or module. The second argument is the symbol to check for.


    You can use it like this...

    var info = Activity.getActivityInfo();
    if (info has :frontDerailleurSize) {
    // do something with it
    }



    As for your localization issue, is the device in question configured to use Chinese as the display language? I believe it would have to be an Asian variant of the device as well.

    Travis
  • Former Member
    Former Member over 8 years ago
    Yes, you can use has to detect if a symbol exists in a class or a module. It is documented in the programmer's guide here...



    You can use it like this...

    var info = Activity.getActivityInfo();
    if (info has :frontDerailleurSize) {
    // do something with it
    }



    As for your localization issue, is the device in question configured to use Chinese as the display language? I believe it would have to be an Asian variant of the device as well.

    Travis




    Thanks for your reply.

    First problem resolved.

    For localization issue, I am not sure what you mean for "in question configured to use Chinese".
    What the recent status is, from Edge device system level, I have already set Language as Chinese, and entire system run with Chinese including Map and Navigation.

    And another area is in Connect mobile App. In the app we can configure some setting parameters. And this area also NOT localized even my entire Connect app run under Chinese.
  • Former Member
    Former Member over 8 years ago
    Updated

    Dear all,

    I have updated this thread with replied information.

    And I 100% sure I have already set language settings on both Connect App and Edge device to Chinese as Display language.
  • Could it be you're always loading the .prg with the English stings on the device? I believe the .prg would be different for different languages.
  • Former Member
    Former Member over 8 years ago
    Could it be you're always loading the .prg with the English stings on the device? I believe the .prg would be different for different languages.




    I have packaged and exported my DataFields with IQ format, then upload onto CIQ app store already.

    All test and monitored behavior are based on formal version that got from CIQ app store.



    Additionally, build PRG file also contains no option for language...
  • What happens if you only put your stings in either "resources-eng" or "resources-chs" and then build the .iq?

    BTW, the .iq is actually a .zip format, so you can open it and see what is there, and pull the .prg that should be in chs format to sideload it and see what it does...
  • Former Member
    Former Member over 8 years ago
    What happens if you only put your stings in either "resources-eng" or "resources-chs" and then build the .iq?

    BTW, the .iq is actually a .zip format, so you can open it and see what is there, and pull the .prg that should be in chs format to sideload it and see what it does...



    I have unzipped the IQ file.

    And checked the JSON files in each sub folders.

    And I found there are JSON files contains Chinese strings which means the language packed into IQ already. But it cannot retrieve Chinese on both Connect Mobile App / GarminExpress software or Edge device.
  • Just a guess, but the language used for app settings may be based on the language setting of the phone or computer running GE. The .json is pulled from the app store when you use app-settings.
  • Former Member
    Former Member over 8 years ago
    Just a guess, but the language used for app settings may be based on the language setting of the phone or computer running GE. The .json is pulled from the app store when you use app-settings.


    All my used mobile app, garmin express and edge device are displayed as s-chinese. Additionally, in mobile app or GE for app settings, it Also does not show s-chinese…


    I am not sure whether that is a bug for s-chinese…