Skip to content

Use "c-format" flag instead of "javascript-format" in POT#752

Merged
lslezak merged 1 commit intomasterfrom
pot_langugage_attribute
Sep 14, 2023
Merged

Use "c-format" flag instead of "javascript-format" in POT#752
lslezak merged 1 commit intomasterfrom
pot_langugage_attribute

Conversation

@lslezak
Copy link
Copy Markdown
Contributor

@lslezak lslezak commented Sep 14, 2023

Problem

  • Originally we used a simple javascript format flag which basically supported only simple %s or %d formats
  • But since we switched to the sprintf-js library (see Use the sprintf-js library instead of format-util #735), which supports full C-like format strings, we can use the c-format flag in the POT file
  • So do not change the language flag and keep the original c-format used by xgettext
  • Additionally the translators might be more familiar with the C format than the Javascript format

Testing

  • Tested manually, the generated POT file contains the c-format flags
  • I manually updated the existing PO files and all translations still validate (via msgfmt --check-format)

Originally we used a simple javascript format but since we switched to
the sprintf-js library which supports full C-like format strings
we can use the "c-format" flag in the POT file
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 72.814%. remained the same when pulling 5e4ea91 on pot_langugage_attribute into 5612a99 on master.

@lslezak lslezak merged commit 5dc90d5 into master Sep 14, 2023
@lslezak lslezak deleted the pot_langugage_attribute branch September 14, 2023 11:33
@imobachgs imobachgs mentioned this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants