You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get_bundle will only load the resources for a single locale, but supports fallback behavior for i18n formatters like date time format (at least it claims to). This bundle will provide no fallback behavior for missing messages.
let res = self.get_resource(res_id,&locales[0].to_string());
get_bundles will iterate over bundles for each locale in the list. I guess you could implement your own fallback behavior for messages here, but the i18n formatters are not provided with a list of locales to fallback upon, so the behavior is different than get_bundle. This seems a bit weird and inconsistent. Firefox is not using this crate, but as an example resource manager, the behavior is a bit odd and inconsistent.
get_bundle
will only load the resources for a single locale, but supports fallback behavior for i18n formatters like date time format (at least it claims to). This bundle will provide no fallback behavior for missing messages.fluent-rs/fluent-resmgr/src/resource_manager.rs
Line 54 in 9e62af6
get_bundles
will iterate over bundles for each locale in the list. I guess you could implement your own fallback behavior for messages here, but thei18n
formatters are not provided with a list of locales to fallback upon, so the behavior is different thanget_bundle
. This seems a bit weird and inconsistent. Firefox is not using this crate, but as an example resource manager, the behavior is a bit odd and inconsistent.fluent-rs/fluent-resmgr/src/resource_manager.rs
Line 71 in 9e62af6
To make them consistent you would either:
A. Remove fallbacking for
get_bundle
and only provide a single locale, not a Vec of locales.B. Pass the locale fallbacks to FluentBundle.
For B I'm unsure which behavior should provided for the fallback list, given:
Locale list:
["en-US", "en-CA", "pl", "es-ES"]
And
en-CA
as the iteration step.Would the locale list be:
i. A slice of the remaining;
["en-CA", "pl", "es-ES"]
ii. A rearranged list:
["en-CA", "en-US", "pl", "es-ES"]
The text was updated successfully, but these errors were encountered: