Language Dependent strings
Is there a safe way to get the value of a language dependent string? For example Account.get.SecuritySubType returns a string which comes from the dictionaries, i.e. "mutualSubType_etf" = "Exchange Traded Fund", which will change with language. If I wish to know the difference between the Mutual Funds type subtypes ETFs and Money Market Funds how can I test for this without hardcoding the English into the extension?
Is there a list of constants available to interrogate language dependent strings?
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Sean Reilly on 31 May, 2018 10:35 AM
Hi Mike,
Great question! It looks like the security subtypes are all stored as already-localised strings, since we thought customers would want to add or edit their subtype names.
The default subtypes from from the com.moneydance.apps.md.controller.SecuritySubtypeManager class which includes the following method. You can get the resource IDs from the code or feel free to copy the whole thing:
Thanks!
Sean Reilly
Developer, The Infinite Kind
http://infinitekind.com
2 Posted by Mike Bray (Quot... on 31 May, 2018 11:27 AM
Thanks Sean
I was looking at it but could not get a link to 'resources' which I
assume is set up within the product. How do I get this?
Regards
Mike
3 Posted by Mike Bray (Quot... on 31 May, 2018 12:56 PM
Hi Sean
I think I have cracked it. I have created a utility class that implements MDResourceProvider when created does:
The getstr("mutualSubType_etf") then does
and returns the string I want. It even comes out in French if the locale is French.
Mike
Mike Bray (Quote Loader Author) closed this discussion on 13 Jun, 2018 12:01 PM.
Mike Bray (Quote Loader Author) re-opened this discussion on 22 Jul, 2018 04:48 AM
Mike Bray (Quote Loader Author) closed this discussion on 22 Jul, 2018 04:48 AM.