Comments (14)
Context: I'm trying to replace https://github.com/robertbastian/icu4x/blob/ec32ad4a79707b1ddb7852ed1653ac2d86c27f3f/provider/datagen/src/baked_exporter.rs#L25 by a version that doesn't use the network (the current test does). However I cannot figure out an invocation for baked that doesn't use fallback.
from icu4x.
_no_fallback
only means no runtime fallback. It still does datagen-time fallback.
You can avoid the datagen-time fallback by using LocaleFamily::FULL
. But, hmm, it's not possible to pass a LocaleFamily
into .with_locales_no_fallback
.
from icu4x.
The invocation I've used in a number of other places to avoid this problem is
.with_locales_and_fallback([LocaleFamily::FULL], Default::default())
from icu4x.
It's not a bug, so unassigning myself.
from icu4x.
The function docs say: "Sets this driver to generate the given locales assuming no runtime fallback."
It's totally reasonable that the driver needs datagen-time fallback in order to generate data that requires no runtime fallback. That's the only way to ensure that the input list of langids can all be fully resolved at datagen time.
We may have previously avoided loading the fallbacker if the explicit langid had an exact match with the supported locales, but now we always load the fallbacker in order to pick up any aux keys and locale extensions from the parent locales, which was a bug before.
from icu4x.
This invocation works with HelloWorldProvider
:
icu4x/provider/blob/src/export/mod.rs
Lines 23 to 27 in 51bd08e
It uses implicit exporter-derived defaults - what's the equivalent invocation for a baked provider?
from icu4x.
I guess it's .with_all_locales().with_fallback_mode(FallbackMode::Hybrid)
, which doesn't exist on the new API?
from icu4x.
.with_all_locales().with_fallback_mode(FallbackMode::Hybrid)
is the same as
.with_locales_and_fallback([LocaleFamily::FULL], FallbackOptions {
deduplication_strategy: Some(DeduplicationStrategy::None),
runtime_fallback_location: Some(RuntimeFallbackLocation::External),
})
from icu4x.
This transformation is implemented in code
(_, Some(legacy_locales), FallbackMode::Hybrid) => {
LocalesWithOrWithoutFallback::WithFallback {
families: map_legacy_locales_to_locales_with_expansion(legacy_locales),
options: FallbackOptions {
runtime_fallback_location: Some(RuntimeFallbackLocation::External),
deduplication_strategy: Some(DeduplicationStrategy::None),
},
}
}
from icu4x.
[LocaleFamily::FULL]
disables locale selection fallback (it forwards all supported locales to the output)DeduplicationStrategy::None
disables the deduplicator, which requires fallbackRuntimeFallbackLocation::External
disables runtime fallback and asserts that LocaleFallbackProvider will be supplied at runtime, so the exporter can proceed with that assumption
I think you should be good if you set all three of those.
from icu4x.
So what's the difference between with_locales_and_fallback
with ::None
and ::External
, and with_locales_no_fallback
?
from icu4x.
So what's the difference between
with_locales_and_fallback
with::None
and::External
, andwith_locales_no_fallback
?
with_locales_no_fallback
is preresolved...
It might be mechanically the same as with_locales_and_fallback
with ::None
and ::External
if all of the locale families are ::single
. However, with_locales_and_fallback
carries with it the assertion that a LocaleFallbackAdapter will be provided at runtime.
from icu4x.
Does this issue change your position on flattening these options to DatagenDriver?
impl DatagenDriver {
pub fn with_locale_families(...)
pub fn with_deduplication(...)
pub fn with_runtime_fallback_location(...)
}
And perhaps change RuntimeFallbackLocation::External
to RuntimeFallbackLocation::ExternalOrDisabled
. Hmm.
from icu4x.
I think I'm fine flattening it.
from icu4x.
Related Issues (20)
- Add Hangul_Syllable_Type enumerated property
- Now might be a good time to figure out off-the-shelf calendar sets in DateTimeFormatter HOT 7
- Transliterator is missing compiled data constructors HOT 4
- Add Temporal CalendarDateDayOfYear to FFI HOT 1
- Incorrect start date for Meiji era HOT 2
- Incorrect week day for Hebrew calendar when ISO year is negative HOT 1
- Integer sizes of day_of_year, day_of_month HOT 1
- Consider proper design for external loader
- Unicode property `Joining_Group` is not exposed by this library. HOT 2
- Import adjusted UTS 46 data from ICU4C 75 branch HOT 1
- icu_provider_blob contains code that will be rejected by a future version of Rust HOT 1
- Panic when IslamicUmmAlQura month has 31 days HOT 1
- Debug assertion failures with ECMA-262 Temporal.PlainDate minimum and maximum values HOT 10
- Consider renaming APIs involving daylight time HOT 2
- Field `region_format_variants` is unused in TimeZoneFormatsV1
- Release ICU4X 1.5
- Investigate 353-day Islamic years
- Fix consistency of from_bytes, try_from_bytes, from_str, try_from_str HOT 15
- Option for am/pm format ? HOT 3
- Separate the AM, PM for vertical layout ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from icu4x.