Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile bombing on bad po file #17266

Closed
jbinpg opened this issue Aug 6, 2024 · 6 comments · Fixed by #17274
Closed

Compile bombing on bad po file #17266

jbinpg opened this issue Aug 6, 2024 · 6 comments · Fixed by #17274
Labels
scope: translation / strings make darktable international

Comments

@jbinpg
Copy link

jbinpg commented Aug 6, 2024

Describe the bug

Did my usual nightly github compile and got this:
-- Configuring done (26.0s)
-- Generating done (3.5s)
-- Build files have been written to: /home/jb/darktable_git/darktable/build
[ 0%] Updating version string (git checkout)
[ 0%] Building af locale
[ 0%] Building zh_TW locale
[ 0%] Building ca locale
4067 translated messages.
Version string: 4.9.0+192~g2ea7c4e492
[ 0%] Built target locale_af
[ 0%] Built target create_version_gen
3058 translated messages.
[ 1%] Building cs locale
[ 1%] Building da locale
[ 1%] Built target locale_ca
[ 1%] Building de locale
/home/jb/darktable_git/darktable/po/zh_TW.po:2: nplurals = 1...
/home/jb/darktable_git/darktable/po/zh_TW.po:7612: ...but some messages have 2 plural forms
/usr/bin/msgfmt: found 1 fatal error
4997 translated messages.

Seems to be something wrong with zh_TW.po

Steps to reproduce

Try to compile.

Expected behavior

Should compile cleanly as usual.

Logfile | Screenshot | Screencast

No response

Commit

No response

Where did you obtain darktable from?

self compiled

darktable version

4.9.0+192~g2ea7c4e492

What OS are you using?

Linux

What is the version of your OS?

Ubuntu 24.04

Describe your system?

System Details Report


Report details

  • Date generated: 2024-08-05 21:44:08

Hardware Information:

  • Hardware Model: Lenovo Lenovo Z51-70
  • Memory: 8.0 GiB
  • Processor: Intel® Core™ i7-5500U × 4
  • Graphics: Intel® HD Graphics 5500 (BDW GT2)
  • Graphics 1: AMD Radeon™ R7 M360
  • Disk Capacity: 1.0 TB

Software Information:

  • Firmware Version: C2CN19WW(V2.00)
  • OS Name: Ubuntu 24.04 LTS
  • OS Build: (null)
  • OS Type: 64-bit
  • GNOME Version: 46
  • Windowing System: Wayland
  • Kernel Version: Linux 6.8.0-39-generic

Are you using OpenCL GPU in darktable?

Yes

If yes, what is the GPU card and driver?

Intel® HD Graphics 5500 (BDW GT2) using Intel driver

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

@ralfbrown
Copy link
Collaborator

ralfbrown commented Aug 6, 2024

Looks like this is the bad entry:

msgid "writing sidecar file"
msgid_plural "writing %zu sidecar files"
msgstr[0] "寫入附屬檔案"
msgstr[1] "寫入 %zu 個附屬檔案"

My guess is that it should have been

msgid "writing sidecar file"
msgid_plural "writing %zu sidecar files"
msgstr[0] "寫入 %zu 個附屬檔案"

@ralfbrown ralfbrown added the scope: translation / strings make darktable international label Aug 6, 2024
@HSUfineprint
Copy link
Contributor

HSUfineprint commented Aug 6, 2024

I got it. It is the Plural-Forms setting.

Chinese or Taiwanese usually don't have plural nouns. The .po has a Plural-Forms: nplurals=1; plural=0;\n setting. But this one, I saw it has different content in msgid_plural and msgid. That's why I use msgstr[0] and msgstr[1].

It's my fault, will use Plural-Forms: nplurals=2; plural=(n != 1);\n and add all other msgstr[1] strings.

@victoryforce
Copy link
Collaborator

But this one, I saw it has different content in msgid_plural and msgid

Yes, in the original (in English), they should be different, because this corresponds to the rules of the English language. But this does not matter for translation, if the target language does not have a plural form, then the translation will be the same.

The main question is the rules of the language into which we translate. If you write that Chinese or Taiwanese don't have plural nouns, then you need to use the formula Plural-Forms: nplurals=1; plural=0

@HSUfineprint
Copy link
Contributor

The main question is the rules of the language into which we translate. If you write that Chinese or Taiwanese don't have plural nouns, then you need to use the formula Plural-Forms: nplurals=1; plural=0

Yes, that's the way in former zh-TW.po files.

But sometimes we will use different article in front of nouns to express singular and plural forms. It depends on the sentence. I think use plural independent setting will make it more solid. Even in most cases the msgstr[1] will be the same with msgstr[0].

@victoryforce
Copy link
Collaborator

But sometimes we will use different article in front of nouns to express singular and plural forms. It depends on the sentence.

Interesting! Got it. I even found good explanation: https://medium.com/@chinesewithnora/the-singular-world-of-plurals-in-chinese-c6307a5cbc25

I think use plural independent setting will make it more solid.

Out of curiosity I looked in the zh_*.po files in a number of projects and everywhere I saw only the formula nplurals=1; plural=0;. No one used the formula with singular and plural. This is a little surprising.

@HSUfineprint
Copy link
Contributor

Out of curiosity I looked in the zh_*.po files in a number of projects and everywhere I saw only the formula nplurals=1; plural=0;. No one used the formula with singular and plural. This is a little surprising.

I believe it's the default setting for zh in Poedit. Chinese and Taiwanese do have some rare plural nouns. Mostly, we use number and different classifier for plural nouns. In practical, the measure words might be omitted. Using nplurals=2 in .po files is more precise, but not necessarily required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: translation / strings make darktable international
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants