Skip to content

Inconsistent YAML quoting for numeric strings starting with 0 (08, 09 vs 01-07)Β #1375

@Skye-flyhigh

Description

@Skye-flyhigh

Describe the bug
Keys/values like 08 and 09 lose their quotes when the YAML is
re-serialized, while 01-07 keep them. This is because 08/09
are invalid octals in YAML 1.1.
Result: the translations for the 08 and 09 keys doesn't stay

Extension Version
lokalise.i18n-ally v.2.13.1

Framework/i18n package you are using

  • Framework: React (Vite)
  • i18n package: react-i18next
  • Locale format: YAML (split by namespace)

To Reproduce
Before:

'07': Value
'08': Value
'09': Value

After i18n-ally edits:

  '07': Value
  08: Value    # Lost quotes!
  09: Value    # Lost quotes!

Steps to reproduce the behavior:

  1. Open a YAML locale file with keys like '08', '09'
  2. Use i18n-ally to translate a string in that file
  3. Save the file
  4. Observe that '08' and '09' keys lost their quotes

Device Infomation

  • OS: macOS
  • Version: 26.2 (25C56)
  • VS Code Version: 1.109.0

Extension Log
Go to View -> Output -> i18n Ally, and paste the content below. You should mask any sensitive information

🌍 Translating "geo.country.ke.subdivision.09" (en->bg)
🌍 Translating "geo.country.ke.subdivision.09" (en->el)
🌍 Translating "geo.country.ke.subdivision.09" (en->fi)
🌍 Translating "geo.country.ke.subdivision.09" (en->no)
🌍 Translating "geo.country.ke.subdivision.09" (en->tr)
πŸ’Ύ Writing /Users/skye/Documents/Coding/NomadsMap/functions/src/shared/locales/bg/geo.yml
πŸ’Ύ Writing /Users/skye/Documents/Coding/NomadsMap/functions/src/shared/locales/el/geo.yml
πŸ’Ύ Writing /Users/skye/Documents/Coding/NomadsMap/functions/src/shared/locales/fi/geo.yml
πŸ’Ύ Writing /Users/skye/Documents/Coding/NomadsMap/functions/src/shared/locales/no/geo.yml
πŸ’Ύ Writing /Users/skye/Documents/Coding/NomadsMap/functions/src/shared/locales/tr/geo.yml
βœ… Loading finished

Expected behavior
Numeric string keys like '08' and '09' should retain their quotes
after the file is re-serialized, consistent with '01'-'07'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions