Updated the string manipulation texts to be prefixed, allowing for better context management if needed for things like "Effects", "System Effects". Added en translations to handle them on the English side. Updated the zh translations using merge:

`msgmerge --update locale/zh_CN/LC_MESSAGES/lang.p o locale/lang.pot`
This commit is contained in:
blitzmann
2020-06-29 20:57:17 -04:00
parent 10a4f62b78
commit 732634fefa
7 changed files with 2360 additions and 2208 deletions

View File

@@ -62,7 +62,7 @@ class PyfaApp(wx.App):
if lang in supLang:
selLang = supLang[lang]
else:
selLang = wx.LANGUAGE_ENGLISH
selLang = wx.LANGUAGE_ENGLISH_US
if self.locale:
assert sys.getrefcount(self.locale) <= 2

View File

@@ -103,10 +103,18 @@ class AddEnvironmentEffect(ContextMenuUnconditional):
def getData(self):
data = Group()
data.groups[_t('Wormhole')] = self.getEffectBeacons(
_t('Black Hole'), _t('Cataclysmic Variable'), _t('Magnetar'),
_t('Pulsar'), _t('Red Giant'), _t('Wolf Rayet'))
data.groups[_t('Sansha Incursion')] = self.getEffectBeacons(_t('Sansha Incursion'))
data.groups[_t('Triglavian Invasion')] = self.getEffectBeacons(_t('Triglavian Invasion'))
_t('ContextMenu|ProjectedEffectManipulation|Black Hole'),
_t('ContextMenu|ProjectedEffectManipulation|Cataclysmic Variable'),
_t('ContextMenu|ProjectedEffectManipulation|Magnetar'),
_t('ContextMenu|ProjectedEffectManipulation|Pulsar'),
_t('ContextMenu|ProjectedEffectManipulation|Red Giant'),
_t('ContextMenu|ProjectedEffectManipulation|Wolf Rayet'))
data.groups[_t('Sansha Incursion')] = self.getEffectBeacons(
_t('ContextMenu|ProjectedEffectManipulation|Sansha Incursion')
)
data.groups[_t('Triglavian Invasion')] = self.getEffectBeacons(
_t('ContextMenu|ProjectedEffectManipulation|Triglavian Invasion')
)
data.groups[_t('Triglavian Invasion')].groups[_t('Destructible Beacons')] = self.getDestructibleBeacons()
data.groups[_t('Abyssal Weather')] = self.getAbyssalWeather()
return data
@@ -122,7 +130,7 @@ class AddEnvironmentEffect(ContextMenuUnconditional):
data = Group()
# Stuff we don't want to see in names
garbages = (_t("System Effects"), _t("Effects"))
garbages = (_t("ContextMenu|ProjectedEffectManipulation|System Effects"), _t("ContextMenu|ProjectedEffectManipulation|Effects"))
# Get group with all the system-wide beacons
grp = sMkt.getGroup("Effect Beacon")

View File

@@ -12,13 +12,14 @@ For Linux and macOS users these tools might be available out-of-box.
### To generate new template for translation:
```console
$ find */ *.py -name "*.py" | xgettext -o locale/lang.pot -d lang -k_t -f -
$ find gui/ *.py -name "*.py" | xgettext --from-code=UTF-8 -o locale/lang.pot -d lang -k_t -f -
```
explanation:
* `find */ *.py -name "*.py"`: collect all `.py` file path in root folder and all sub-folder, write it to stdout
* `find gui/ *.py -name "*.py"`: collect all `.py` file path in `gui` folder and all sub-folders, write it to stdout
* `xgettext`: a utility looking for keyword and put string literals in a specific format for human translation
* `--from-code=UTF-8`: designates encoding of files
* `-o locale/lang.pot`: let `xgettext` write to `locale/lang.pot`
* `-d lang`: default language domain is `lang`
* `-k_t`: besides default keyword (including `_`, see `info xgettext` for detail), also look for `_t`

View File

@@ -1,21 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2020-05-14 01:11-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
#: ./gui/mainFrame.py:189
msgid "Market"
msgstr "de Market"

View File

@@ -0,0 +1,58 @@
# English translations for PACKAGE package.
# Copyright (C) 2020 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# <holmes.ryan.90@gmail.com>, 2020.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-06-29 20:32-0400\n"
"PO-Revision-Date: 2020-06-29 20:35-0400\n"
"Last-Translator: <holmes.ryan.90@gmail.com>\n"
"Language-Team: English\n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ASCII\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: gui/builtinContextMenus/envEffectAdd.py:106
msgid "ContextMenu|ProjectedEffectManipulation|Black Hole"
msgstr "Black Hole"
#: gui/builtinContextMenus/envEffectAdd.py:107
msgid "ContextMenu|ProjectedEffectManipulation|Cataclysmic Variable"
msgstr "Cataclysmic Variable"
#: gui/builtinContextMenus/envEffectAdd.py:108
msgid "ContextMenu|ProjectedEffectManipulation|Magnetar"
msgstr "Magnetar"
#: gui/builtinContextMenus/envEffectAdd.py:109
msgid "ContextMenu|ProjectedEffectManipulation|Pulsar"
msgstr "Pulsar"
#: gui/builtinContextMenus/envEffectAdd.py:110
msgid "ContextMenu|ProjectedEffectManipulation|Red Giant"
msgstr "Red Giant"
#: gui/builtinContextMenus/envEffectAdd.py:111
msgid "ContextMenu|ProjectedEffectManipulation|Wolf Rayet"
msgstr "Wolf Rayet"
#: gui/builtinContextMenus/envEffectAdd.py:113
msgid "ContextMenu|ProjectedEffectManipulation|Sansha Incursion"
msgstr "Sansha Incursion"
#: gui/builtinContextMenus/envEffectAdd.py:116
msgid "ContextMenu|ProjectedEffectManipulation|Triglavian Invasion"
msgstr "Triglavian Invasion"
#: gui/builtinContextMenus/envEffectAdd.py:133
msgid "ContextMenu|ProjectedEffectManipulation|System Effects"
msgstr "System Effects"
#: gui/builtinContextMenus/envEffectAdd.py:133
msgid "ContextMenu|ProjectedEffectManipulation|Effects"
msgstr "Effects"

File diff suppressed because it is too large Load Diff

View File

@@ -540,7 +540,7 @@ class LocaleSettings:
_instance = None
supported_langauges = {
"en_US": wx.LANGUAGE_ENGLISH,
"en_US": wx.LANGUAGE_ENGLISH_US,
"zh_CN": wx.LANGUAGE_CHINESE_SIMPLIFIED,
# todo: add the others that EVE supports
}