Use dashes instead of underscores in fluent names
This commit is contained in:
parent
9b21131278
commit
34d6f08f4d
@ -1,5 +1,5 @@
|
||||
builtin_macros-requires-cfg-pattern =
|
||||
builtin-macros-requires-cfg-pattern =
|
||||
macro requires a cfg-pattern as an argument
|
||||
.label = cfg-pattern required
|
||||
|
||||
builtin_macros-expected-one-cfg-pattern = expected 1 cfg-pattern
|
||||
builtin-macros-expected-one-cfg-pattern = expected 1 cfg-pattern
|
||||
|
@ -189,9 +189,13 @@ pub(crate) fn fluent_messages(input: proc_macro::TokenStream) -> proc_macro::Tok
|
||||
if let Entry::Message(Message { id: Identifier { name }, attributes, .. }) = entry {
|
||||
let _ = previous_defns.entry(name.to_string()).or_insert(ident_span);
|
||||
|
||||
// `typeck-foo-bar` => `foo_bar`
|
||||
// `typeck-foo-bar` => `foo_bar` (in `typeck.ftl`)
|
||||
// `const-eval-baz` => `baz` (in `const_eval.ftl`)
|
||||
let snake_name = Ident::new(
|
||||
&name.replace(&format!("{}-", res.ident), "").replace("-", "_"),
|
||||
// FIXME: should probably trim prefix, not replace all occurrences
|
||||
&name
|
||||
.replace(&format!("{}-", res.ident).replace("_", "-"), "")
|
||||
.replace("-", "_"),
|
||||
span,
|
||||
);
|
||||
constants.extend(quote! {
|
||||
|
Loading…
Reference in New Issue
Block a user