@@ -149,6 +149,21 @@ fn embed_single_utility_locale(
149149 project_root. join ( format ! ( "src/uucore/locales/{locale}.ftl" ) )
150150 } ) ?;
151151
152+ // Conditionally embed SELinux locales when the selinux feature is enabled
153+ #[ cfg( feature = "selinux" ) ]
154+ embed_component_locales (
155+ embedded_file,
156+ locales_to_embed,
157+ "uucore/selinux" ,
158+ |locale| project_root. join ( format ! ( "src/uucore/locales/selinux/{locale}.ftl" ) ) ,
159+ ) ?;
160+
161+ // Conditionally embed SMACK locales when the smack feature is enabled
162+ #[ cfg( feature = "smack" ) ]
163+ embed_component_locales ( embedded_file, locales_to_embed, "uucore/smack" , |locale| {
164+ project_root. join ( format ! ( "src/uucore/locales/smack/{locale}.ftl" ) )
165+ } ) ?;
166+
152167 Ok ( ( ) )
153168}
154169
@@ -199,6 +214,21 @@ fn embed_all_utility_locales(
199214 project_root. join ( format ! ( "src/uucore/locales/{locale}.ftl" ) )
200215 } ) ?;
201216
217+ // Conditionally embed SELinux locales when the selinux feature is enabled
218+ #[ cfg( feature = "selinux" ) ]
219+ embed_component_locales (
220+ embedded_file,
221+ locales_to_embed,
222+ "uucore/selinux" ,
223+ |locale| project_root. join ( format ! ( "src/uucore/locales/selinux/{locale}.ftl" ) ) ,
224+ ) ?;
225+
226+ // Conditionally embed SMACK locales when the smack feature is enabled
227+ #[ cfg( feature = "smack" ) ]
228+ embed_component_locales ( embedded_file, locales_to_embed, "uucore/smack" , |locale| {
229+ project_root. join ( format ! ( "src/uucore/locales/smack/{locale}.ftl" ) )
230+ } ) ?;
231+
202232 embedded_file. flush ( ) ?;
203233 Ok ( ( ) )
204234}
@@ -230,6 +260,21 @@ fn embed_static_utility_locales(
230260 Path :: new ( & manifest_dir) . join ( format ! ( "locales/{locale}.ftl" ) )
231261 } ) ?;
232262
263+ // Conditionally embed SELinux locales when the selinux feature is enabled
264+ #[ cfg( feature = "selinux" ) ]
265+ embed_component_locales (
266+ embedded_file,
267+ locales_to_embed,
268+ "uucore/selinux" ,
269+ |locale| Path :: new ( & manifest_dir) . join ( format ! ( "locales/selinux/{locale}.ftl" ) ) ,
270+ ) ?;
271+
272+ // Conditionally embed SMACK locales when the smack feature is enabled
273+ #[ cfg( feature = "smack" ) ]
274+ embed_component_locales ( embedded_file, locales_to_embed, "uucore/smack" , |locale| {
275+ Path :: new ( & manifest_dir) . join ( format ! ( "locales/smack/{locale}.ftl" ) )
276+ } ) ?;
277+
233278 // Collect and sort for deterministic builds
234279 let mut entries: Vec < _ > = std:: fs:: read_dir ( registry_dir) ?
235280 . filter_map ( Result :: ok)
0 commit comments