Fix extraction of locale from translation files

The `LocaleExtractor` recognizes these kind of files:

  - `<locale>.yaml`
  - `<locale>_something.yaml`

It does not recognize these files we use:

  - `js-<locale>.yaml` (locale is extracted as `js-<locale>`)
  - `<locale>.seeders.yaml` (locale is extracted as `<locale>.seeders`)

It's fixed by deleting the `js-` prefix and the `.seeders` suffix from
the extracted locale.
This commit is contained in:
Christophe Bliard
2024-10-14 08:34:30 +02:00
parent 9ffe495b98
commit cbf338bc07
+1 -1
View File
@@ -39,7 +39,7 @@ class I18n::Backend::LocaleExtractor
return if locale.nil?
locale.tr("js-", "").to_sym
locale.delete_prefix("js-").delete_suffix(".seeders").to_sym
end
end