summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorGravatar Kyle Kienapfel2022-06-24 21:16:34 -0700
committerGravatar Kyle K2022-07-30 01:40:33 -0700
commit7e0afc641c520d85780074ec685fac1d9fc3e215 (patch)
tree8727502b96d1ef046b6dc689a64b0c8e350f424d /dist
parentUpdate bug-report-feature-request.md (diff)
downloadyuzu-7e0afc641c520d85780074ec685fac1d9fc3e215.tar.gz
yuzu-7e0afc641c520d85780074ec685fac1d9fc3e215.tar.xz
yuzu-7e0afc641c520d85780074ec685fac1d9fc3e215.zip
Translate english plurals
Turns out that for Qt to properly handle plurals in English a translation needs to be provided, otherwise the user is left with messages such as "Building: 2 shader(s)" Plurals for other all other languages are handled on transifex. I wrote the README.md to just refer to it as a translation collaboration site just in case we ever switch. These translations being out of date won't pose any technical problems so I believe it is fine to handle them manually on a "best effort" basis. The files are generated into the source directory so that the relative filenames are correct. The generated file is added to .gitignore
Diffstat (limited to 'dist')
-rw-r--r--dist/english_plurals/README.md19
-rw-r--r--dist/english_plurals/en.ts67
2 files changed, 86 insertions, 0 deletions
diff --git a/dist/english_plurals/README.md b/dist/english_plurals/README.md
new file mode 100644
index 000000000..a4954f6a6
--- /dev/null
+++ b/dist/english_plurals/README.md
@@ -0,0 +1,19 @@
1# English Plurals
2
3Qt has "Translation Rules for Plurals", small example
4
5 // Take a source line like
6 tr("Building: %n shader(s)", "", i)
7
8 // i = 1:
9 Building: 1 shader
10 // i = 2:
11 Building: 2 shaders
12
13For yuzu the source language used is English, for all other languages handling of plurals is handled by Qt and the translation collaboration site. Handling plurals in the source language (English) requires special consideration.
14
15With CMake flag GENERATE_QT_TRANSLATION a generated_en.ts file is created from the source. It ignored by git (`.gitignore` in the project root). It is placed in this directory so that the relative refrences with the source code is correct.
16
17Having the plurals look nice isn't critical, and automation to use translation collaboration sites may require specifing the project language as "Pirate English", so this has been done manually.
18
19The en.ts in this directory is taken from a build, edited in Qt Linguist and then committed. As the code is in XML, using the tool is not strictly required.
diff --git a/dist/english_plurals/en.ts b/dist/english_plurals/en.ts
new file mode 100644
index 000000000..172cd4bba
--- /dev/null
+++ b/dist/english_plurals/en.ts
@@ -0,0 +1,67 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE TS>
3<TS version="2.1" language="en_US" sourcelanguage="en_US">
4<context>
5 <name>GMainWindow</name>
6 <message numerus="yes">
7 <location filename="../../src/yuzu/main.cpp" line="2322"/>
8 <source>%n file(s) remaining</source>
9 <translation>
10 <numerusform>%n file remaining</numerusform>
11 <numerusform>%n files remaining</numerusform>
12 </translation>
13 </message>
14 <message numerus="yes">
15 <location filename="../../src/yuzu/main.cpp" line="2377"/>
16 <source>%n file(s) were newly installed
17</source>
18 <translation>
19 <numerusform>%n file was newly installed
20</numerusform>
21 <numerusform>%n files were newly installed
22</numerusform>
23 </translation>
24 </message>
25 <message numerus="yes">
26 <location filename="../../src/yuzu/main.cpp" line="2380"/>
27 <source>%n file(s) were overwritten
28</source>
29 <translation>
30 <numerusform>%n file was overwritten
31</numerusform>
32 <numerusform>%n were overwritten
33</numerusform>
34 </translation>
35 </message>
36 <message numerus="yes">
37 <location filename="../../src/yuzu/main.cpp" line="2382"/>
38 <source>%n file(s) failed to install
39</source>
40 <translation>
41 <numerusform>%n file failed to install
42</numerusform>
43 <numerusform>%n files failed to install
44</numerusform>
45 </translation>
46 </message>
47 <message numerus="yes">
48 <location filename="../../src/yuzu/main.cpp" line="3264"/>
49 <source>Building: %n shader(s)</source>
50 <translation>
51 <numerusform>Building: %n shader</numerusform>
52 <numerusform>Building: %n shaders</numerusform>
53 </translation>
54 </message>
55</context>
56<context>
57 <name>GameListSearchField</name>
58 <message numerus="yes">
59 <location filename="../../src/yuzu/game_list.cpp" line="87"/>
60 <source>%1 of %n result(s)</source>
61 <translation>
62 <numerusform>%1 of %n result</numerusform>
63 <numerusform>%1 of %n results</numerusform>
64 </translation>
65 </message>
66</context>
67</TS>