@@ -101,6 +101,7 @@ pub fn fluent_bundle(
101101 sysroot : & Path ,
102102 requested_locale : Option < LanguageIdentifier > ,
103103 additional_ftl_path : Option < & Path > ,
104+ with_directionality_markers : bool ,
104105) -> Result < Option < Lrc < FluentBundle > > , TranslationBundleError > {
105106 if requested_locale. is_none ( ) && additional_ftl_path. is_none ( ) {
106107 return Ok ( None ) ;
@@ -120,7 +121,7 @@ pub fn fluent_bundle(
120121 // vice-versa). These are disabled because they are sometimes visible in the error output, but
121122 // may be worth investigating in future (for example: if type names are left-to-right and the
122123 // 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 ) ;
124125
125126 // If the user requests the default locale then don't try to load anything.
126127 if !requested_fallback_locale && let Some ( requested_locale) = requested_locale {
@@ -169,13 +170,15 @@ pub fn fluent_bundle(
169170
170171/// Return the default `FluentBundle` with standard "en-US" diagnostic messages.
171172#[ 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 > {
173176 let fallback_resource = FluentResource :: try_new ( FALLBACK_FLUENT_RESOURCE . to_string ( ) )
174177 . map_err ( TranslationBundleError :: from) ?;
175178 trace ! ( ?fallback_resource) ;
176179 let mut fallback_bundle = FluentBundle :: new ( vec ! [ langid!( "en-US" ) ] ) ;
177180 // See comment in `fluent_bundle`.
178- fallback_bundle. set_use_isolating ( false ) ;
181+ fallback_bundle. set_use_isolating ( with_directionality_markers ) ;
179182 fallback_bundle. add_resource ( fallback_resource) . map_err ( TranslationBundleError :: from) ?;
180183 let fallback_bundle = Lrc :: new ( fallback_bundle) ;
181184 Ok ( fallback_bundle)
0 commit comments