@@ -101,6 +101,7 @@ pub fn fluent_bundle(
101
101
sysroot : & Path ,
102
102
requested_locale : Option < LanguageIdentifier > ,
103
103
additional_ftl_path : Option < & Path > ,
104
+ with_directionality_markers : bool ,
104
105
) -> Result < Option < Lrc < FluentBundle > > , TranslationBundleError > {
105
106
if requested_locale. is_none ( ) && additional_ftl_path. is_none ( ) {
106
107
return Ok ( None ) ;
@@ -120,7 +121,7 @@ pub fn fluent_bundle(
120
121
// vice-versa). These are disabled because they are sometimes visible in the error output, but
121
122
// may be worth investigating in future (for example: if type names are left-to-right and the
122
123
// surrounding diagnostic messages are right-to-left, then these might be helpful).
123
- bundle. set_use_isolating ( false ) ;
124
+ bundle. set_use_isolating ( with_directionality_markers ) ;
124
125
125
126
// If the user requests the default locale then don't try to load anything.
126
127
if !requested_fallback_locale && let Some ( requested_locale) = requested_locale {
@@ -169,13 +170,15 @@ pub fn fluent_bundle(
169
170
170
171
/// Return the default `FluentBundle` with standard "en-US" diagnostic messages.
171
172
#[ instrument( level = "trace" ) ]
172
- pub fn fallback_fluent_bundle ( ) -> Result < Lrc < FluentBundle > , TranslationBundleError > {
173
+ pub fn fallback_fluent_bundle (
174
+ with_directionality_markers : bool ,
175
+ ) -> Result < Lrc < FluentBundle > , TranslationBundleError > {
173
176
let fallback_resource = FluentResource :: try_new ( FALLBACK_FLUENT_RESOURCE . to_string ( ) )
174
177
. map_err ( TranslationBundleError :: from) ?;
175
178
trace ! ( ?fallback_resource) ;
176
179
let mut fallback_bundle = FluentBundle :: new ( vec ! [ langid!( "en-US" ) ] ) ;
177
180
// See comment in `fluent_bundle`.
178
- fallback_bundle. set_use_isolating ( false ) ;
181
+ fallback_bundle. set_use_isolating ( with_directionality_markers ) ;
179
182
fallback_bundle. add_resource ( fallback_resource) . map_err ( TranslationBundleError :: from) ?;
180
183
let fallback_bundle = Lrc :: new ( fallback_bundle) ;
181
184
Ok ( fallback_bundle)
0 commit comments