singleton
singleton copied to clipboard
[BUG] [Ruby Client] Can't configure source and fallback locales in config file.
Describe the bug The client is not fetching a list of fallback locales and source localle from client configuration file. Instead, a "default" locale is hardcoded.
To Reproduce Steps to reproduce the behavior:
- Use the ruby client in a sample application.
- As in this code in the sample app, the following line loads the source bundle:
SgtnClient::Source.loadBundles("default")
- Error: Step 2 also initializes
SgtnClient::Config.configurations.default
to "default". The value should have come from the config file sgtnclient.yml instead.
Notice that in the client configuration file, there is no config to set the following:
- list of fallback locales (ordered in priority)
- source locale
Expected behavior The above two configurations must be in the client config file. These are to be used for the client library workflow logic below.
When target locale is not supported, invalid or nil: a. If list of fallback locales is NOT configured in the client config file, getString must return the source string. b. If list of fallback locales is configured in the client config file, getString must use the next fallback locale from the list as target locale, and return the translation. It must go through the list until it is able to return a translation in a fallback locale. If at the end of the list and all fallback locales failed, it must return the source string.
How to define the list of fallback locales, could you provide an example?