mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-10 20:02:13 +08:00
Multilang: handle localized plurals (#25337)
* Add localized plural handling * Do another location with plurals * fix test old-commit-hash: ecba8732088d27fac84c9d1c84c6082e0638009f
This commit is contained in:
@@ -79,13 +79,13 @@ QString timeAgo(const QDateTime &date) {
|
||||
s = "now";
|
||||
} else if (diff < 60 * 60) {
|
||||
int minutes = diff / 60;
|
||||
s = QObject::tr("%1 minute%2 ago").arg(minutes).arg(minutes > 1 ? "s" : "");
|
||||
s = QObject::tr("%n minute(s) ago", "", minutes);
|
||||
} else if (diff < 60 * 60 * 24) {
|
||||
int hours = diff / (60 * 60);
|
||||
s = QObject::tr("%1 hour%2 ago").arg(hours).arg(hours > 1 ? "s" : "");
|
||||
s = QObject::tr("%n hour(s) ago", "", hours);
|
||||
} else if (diff < 3600 * 24 * 7) {
|
||||
int days = diff / (60 * 60 * 24);
|
||||
s = QObject::tr("%1 day%2 ago").arg(days).arg(days > 1 ? "s" : "");
|
||||
s = QObject::tr("%n day(s) ago", "", days);
|
||||
} else {
|
||||
s = date.date().toString();
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ void InputDialog::handleEnter() {
|
||||
done(QDialog::Accepted);
|
||||
emitText(line->text());
|
||||
} else {
|
||||
setMessage(tr("Need at least %1 characters!").arg(minLength), false);
|
||||
setMessage(tr("Need at least %n character(s)!", "", minLength), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class TestTranslations(unittest.TestCase):
|
||||
f"{name} has no XML translation file, run selfdrive/ui/update_translations.py")
|
||||
|
||||
def test_translations_updated(self):
|
||||
update_translations(translations_dir=TMP_TRANSLATIONS_DIR)
|
||||
update_translations(plural_only=["main_en"], translations_dir=TMP_TRANSLATIONS_DIR)
|
||||
|
||||
for name, file in self.translation_files.items():
|
||||
with self.subTest(name=name, file=file):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"English": "",
|
||||
"English": "main_en",
|
||||
"中文(繁體)": "main_zh-CHT",
|
||||
"中文(简体)": "main_zh-CHS",
|
||||
"한국어": "main_ko"
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>InputDialog</name>
|
||||
<message numerus="yes">
|
||||
<source>Need at least %n character(s)!</source>
|
||||
<translation>
|
||||
<numerusform>Need at least %n character!</numerusform>
|
||||
<numerusform>Need at least %n characters!</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message numerus="yes">
|
||||
<source>%n minute(s) ago</source>
|
||||
<translation>
|
||||
<numerusform>%n minute ago</numerusform>
|
||||
<numerusform>%n minutes ago</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>%n hour(s) ago</source>
|
||||
<translation>
|
||||
<numerusform>%n hour ago</numerusform>
|
||||
<numerusform>%n hours ago</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>%n day(s) ago</source>
|
||||
<translation>
|
||||
<numerusform>%n day ago</numerusform>
|
||||
<numerusform>%n days ago</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@@ -108,152 +108,152 @@
|
||||
<context>
|
||||
<name>DevicePanel</name>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="106"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="100"/>
|
||||
<source>Dongle ID</source>
|
||||
<translation>ドングル番号 (Dongle ID)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="106"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="100"/>
|
||||
<source>N/A</source>
|
||||
<translation>N/A</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="107"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="101"/>
|
||||
<source>Serial</source>
|
||||
<translation>シリアル番号</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="111"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="105"/>
|
||||
<source>Driver Camera</source>
|
||||
<translation>車内カメラ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="111"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="105"/>
|
||||
<source>PREVIEW</source>
|
||||
<translation>見る</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="112"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="106"/>
|
||||
<source>Preview the driver facing camera to ensure that driver monitoring has good visibility. (vehicle must be off)</source>
|
||||
<translation>車内カメラをプレビューして、ドライバー監視システムの視界を確認ができます。(車両の電源を切る必要があります)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="116"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="110"/>
|
||||
<source>Reset Calibration</source>
|
||||
<translation>キャリブレーションをリセット</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="116"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="110"/>
|
||||
<source>RESET</source>
|
||||
<translation>リセット</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="119"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="113"/>
|
||||
<source>Are you sure you want to reset calibration?</source>
|
||||
<translation>キャリブレーションをリセットしてもよろしいですか?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="126"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="120"/>
|
||||
<source>Review Training Guide</source>
|
||||
<translation>入門書を見る</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="126"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="120"/>
|
||||
<source>REVIEW</source>
|
||||
<translation>見る</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="126"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="120"/>
|
||||
<source>Review the rules, features, and limitations of openpilot</source>
|
||||
<translation>openpilot の特徴を見る</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="128"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="122"/>
|
||||
<source>Are you sure you want to review the training guide?</source>
|
||||
<translation>入門書を見てもよろしいですか?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="136"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="130"/>
|
||||
<source>Regulatory</source>
|
||||
<translation>認証情報</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="136"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="130"/>
|
||||
<source>VIEW</source>
|
||||
<translation>見る</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="144"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="138"/>
|
||||
<source>Change Language</source>
|
||||
<translation>言語を変更</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="144"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="138"/>
|
||||
<source>CHANGE</source>
|
||||
<translation>変更</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="148"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="142"/>
|
||||
<source>Select a language</source>
|
||||
<translation>言語を選択</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="168"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="162"/>
|
||||
<source>Reboot</source>
|
||||
<translation>再起動</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="173"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="167"/>
|
||||
<source>Power Off</source>
|
||||
<translation>電源を切る</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="193"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="187"/>
|
||||
<source>openpilot requires the device to be mounted within 4° left or right and within 5° up or 8° down. openpilot is continuously calibrating, resetting is rarely required.</source>
|
||||
<translation>openpilot は、左または右の4°以内、上の5°または下の8°以内にデバイスを取付ける必要があります。キャリブレーションを引き続きます、リセットはほとんど必要ありません。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="204"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="198"/>
|
||||
<source> Your device is pointed %1° %2 and %3° %4.</source>
|
||||
<translation> このデバイスは%2の%1°、%4の%3°に向けます。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="205"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="199"/>
|
||||
<source>down</source>
|
||||
<translation>下</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="205"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="199"/>
|
||||
<source>up</source>
|
||||
<translation>上</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="206"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="200"/>
|
||||
<source>left</source>
|
||||
<translation>左</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="206"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="200"/>
|
||||
<source>right</source>
|
||||
<translation>右</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="217"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="211"/>
|
||||
<source>Are you sure you want to reboot?</source>
|
||||
<translation>再起動してもよろしいですか?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="224"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="218"/>
|
||||
<source>Disengage to Reboot</source>
|
||||
<translation>openpilot をキャンセルして再起動ができます</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="230"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="224"/>
|
||||
<source>Are you sure you want to power off?</source>
|
||||
<translation>シャットダウンしてもよろしいですか?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="237"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="231"/>
|
||||
<source>Disengage to Power Off</source>
|
||||
<translation>openpilot をキャンセルしてシャットダウンができます</translation>
|
||||
</message>
|
||||
@@ -294,7 +294,7 @@
|
||||
<context>
|
||||
<name>DriverViewScene</name>
|
||||
<message>
|
||||
<location filename="../qt/offroad/driverview.cc" line="56"/>
|
||||
<location filename="../qt/offroad/driverview.cc" line="55"/>
|
||||
<source>camera starting</source>
|
||||
<translation>カメラを起動しています</translation>
|
||||
</message>
|
||||
@@ -306,10 +306,16 @@
|
||||
<source>Cancel</source>
|
||||
<translation>キャンセル</translation>
|
||||
</message>
|
||||
<message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/widgets/input.cc" line="168"/>
|
||||
<source>Need at least %n character(s)!</source>
|
||||
<translation>
|
||||
<numerusform>パスワードは%%n文字以上で入力してください!</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Need at least %1 characters!</source>
|
||||
<translation>パスワードは%%1文字以上で入力してください!</translation>
|
||||
<translation type="vanished">パスワードは%%1文字以上で入力してください!</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -488,30 +494,30 @@ location set</source>
|
||||
<context>
|
||||
<name>NvgWindow</name>
|
||||
<message>
|
||||
<location filename="../qt/onroad.cc" line="208"/>
|
||||
<location filename="../qt/onroad.cc" line="212"/>
|
||||
<source>km/h</source>
|
||||
<translation>km/h</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/onroad.cc" line="208"/>
|
||||
<location filename="../qt/onroad.cc" line="212"/>
|
||||
<source>mph</source>
|
||||
<translation>mph</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/onroad.cc" line="275"/>
|
||||
<location filename="../qt/onroad.cc" line="278"/>
|
||||
<location filename="../qt/onroad.cc" line="280"/>
|
||||
<location filename="../qt/onroad.cc" line="283"/>
|
||||
<source>MAX</source>
|
||||
<translation>最高速度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/onroad.cc" line="322"/>
|
||||
<location filename="../qt/onroad.cc" line="325"/>
|
||||
<location filename="../qt/onroad.cc" line="327"/>
|
||||
<location filename="../qt/onroad.cc" line="330"/>
|
||||
<source>SPEED</source>
|
||||
<translation>速度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/onroad.cc" line="328"/>
|
||||
<location filename="../qt/onroad.cc" line="331"/>
|
||||
<location filename="../qt/onroad.cc" line="333"/>
|
||||
<location filename="../qt/onroad.cc" line="336"/>
|
||||
<source>LIMIT</source>
|
||||
<translation>制限速度</translation>
|
||||
</message>
|
||||
@@ -635,20 +641,38 @@ location set</source>
|
||||
<source>openpilot</source>
|
||||
<translation>openpilot</translation>
|
||||
</message>
|
||||
<message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/util.cc" line="82"/>
|
||||
<source>%1 minute%2 ago</source>
|
||||
<translation>%1 分%2 前</translation>
|
||||
<source>%n minute(s) ago</source>
|
||||
<translation>
|
||||
<numerusform>%n 分前</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/util.cc" line="85"/>
|
||||
<source>%1 hour%2 ago</source>
|
||||
<translation>%1 時間%2 前</translation>
|
||||
<source>%n hour(s) ago</source>
|
||||
<translation>
|
||||
<numerusform>%n 時間前</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/util.cc" line="88"/>
|
||||
<source>%n day(s) ago</source>
|
||||
<translation>
|
||||
<numerusform>%n 日前</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 minute%2 ago</source>
|
||||
<translation type="vanished">%1 分%2 前</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 hour%2 ago</source>
|
||||
<translation type="vanished">%1 時間%2 前</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/util.cc" line="88"/>
|
||||
<source>%1 day%2 ago</source>
|
||||
<translation>%1 日%2 前</translation>
|
||||
<translation type="vanished">%1 日%2 前</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -710,33 +734,33 @@ location set</source>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="338"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="332"/>
|
||||
<source>×</source>
|
||||
<translation>×</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="364"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="358"/>
|
||||
<source>Device</source>
|
||||
<translation>デバイス</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="365"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="404"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="359"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="398"/>
|
||||
<source>Network</source>
|
||||
<translation>ネットワーク</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="366"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="360"/>
|
||||
<source>Toggles</source>
|
||||
<translation>切り替え</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="367"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="361"/>
|
||||
<source>Software</source>
|
||||
<translation>ソフトウェア</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="372"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="366"/>
|
||||
<source>Navigation</source>
|
||||
<translation>ナビゲーション</translation>
|
||||
</message>
|
||||
@@ -975,89 +999,89 @@ location set</source>
|
||||
<context>
|
||||
<name>SoftwarePanel</name>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="242"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="236"/>
|
||||
<source>Git Branch</source>
|
||||
<translation>Git ブランチ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="243"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="237"/>
|
||||
<source>Git Commit</source>
|
||||
<translation>Git コミット</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="244"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="238"/>
|
||||
<source>OS Version</source>
|
||||
<translation>OS バージョン</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="245"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="239"/>
|
||||
<source>Version</source>
|
||||
<translation>バージョン</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="246"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="240"/>
|
||||
<source>Last Update Check</source>
|
||||
<translation>最終更新確認</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="246"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="240"/>
|
||||
<source>The last time openpilot successfully checked for an update. The updater only runs while the car is off.</source>
|
||||
<translation>openpilotが最後にアップデートの確認に成功してからの時間です。アップデート処理は、車の電源が切れているときのみ実行されます。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="247"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="241"/>
|
||||
<source>Check for Update</source>
|
||||
<translation>更新プログラムをチェック</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="252"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="246"/>
|
||||
<source>CHECKING</source>
|
||||
<translation>確認中</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="259"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="253"/>
|
||||
<source>Switch Branch</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="259"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="253"/>
|
||||
<source>ENTER</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="259"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="261"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="253"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="255"/>
|
||||
<source>The new branch will be pulled the next time the updater runs.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="261"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="255"/>
|
||||
<source>Enter branch name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="272"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="266"/>
|
||||
<source>UNINSTALL</source>
|
||||
<translation>アンインストール</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="272"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="266"/>
|
||||
<source>Uninstall %1</source>
|
||||
<translation>%1をアンインストール</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="274"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="268"/>
|
||||
<source>Are you sure you want to uninstall?</source>
|
||||
<translation>アンインストールしてもよろしいですか?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="291"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="285"/>
|
||||
<source>failed to fetch update</source>
|
||||
<translation>更新のダウンロードにエラーが発生しました</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="292"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="313"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="286"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="307"/>
|
||||
<source>CHECK</source>
|
||||
<translation>確認</translation>
|
||||
</message>
|
||||
@@ -1165,72 +1189,70 @@ location set</source>
|
||||
<translation>時速31マイル(50km)を超えるスピードで走行中、方向指示器を作動させずに検出された車線ライン上に車両が触れた場合、車線に戻るアラートを受信します。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="46"/>
|
||||
<source>Enable Right-Hand Drive</source>
|
||||
<translation>右ハンドルを有効化</translation>
|
||||
<translation type="vanished">右ハンドルを有効化</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="47"/>
|
||||
<source>Allow openpilot to obey left-hand traffic conventions and perform driver monitoring on right driver seat.</source>
|
||||
<translation>openpilot が左側通行規則を遵守し、右ハンドルでドライバー監視を行うことを可能にします。</translation>
|
||||
<translation type="vanished">openpilot が左側通行規則を遵守し、右ハンドルでドライバー監視を行うことを可能にします。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="52"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="46"/>
|
||||
<source>Use Metric System</source>
|
||||
<translation>メートル法を有効化</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="53"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="47"/>
|
||||
<source>Display speed in km/h instead of mph.</source>
|
||||
<translation>速度は mph ではなく km/h で表示されます。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="58"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="52"/>
|
||||
<source>Record and Upload Driver Camera</source>
|
||||
<translation>車内カメラの録画とアップロード</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="59"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="53"/>
|
||||
<source>Upload data from the driver facing camera and help improve the driver monitoring algorithm.</source>
|
||||
<translation>車内カメラの映像をアップロードし、ドライバー監視システムのアルゴリズムの向上に役立てます。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="64"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="58"/>
|
||||
<source>Disengage On Accelerator Pedal</source>
|
||||
<translation>アクセル踏むと openpilot をキャンセル</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="65"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="59"/>
|
||||
<source>When enabled, pressing the accelerator pedal will disengage openpilot.</source>
|
||||
<translation>有効な場合は、アクセルを踏むと openpilot をキャンセルします。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="71"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="65"/>
|
||||
<source>Show ETA in 24h format</source>
|
||||
<translation>24時間表示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="72"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="66"/>
|
||||
<source>Use 24h format instead of am/pm</source>
|
||||
<translation>AM/PM の代わりに24時間形式を使用します</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="77"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="71"/>
|
||||
<source>Show Map on Left Side of UI</source>
|
||||
<translation>ディスプレイの左側にマップを表示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="78"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="72"/>
|
||||
<source>Show map on left side when in split screen view.</source>
|
||||
<translation>分割画面表示の場合、ディスプレイの左側にマップを表示します。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="90"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="84"/>
|
||||
<source>openpilot Longitudinal Control</source>
|
||||
<translation>openpilot 縦方向制御</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/offroad/settings.cc" line="91"/>
|
||||
<location filename="../qt/offroad/settings.cc" line="85"/>
|
||||
<source>openpilot will disable the car's radar and will take over control of gas and brakes. Warning: this disables AEB!</source>
|
||||
<translation>openpilot は、車のレーダーを無効化し、アクセルとブレーキの制御を引き継ぎます。注意:AEB を無効化にします!</translation>
|
||||
</message>
|
||||
|
||||
@@ -306,10 +306,16 @@
|
||||
<source>Cancel</source>
|
||||
<translation>취소</translation>
|
||||
</message>
|
||||
<message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/widgets/input.cc" line="168"/>
|
||||
<source>Need at least %n character(s)!</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Need at least %1 characters!</source>
|
||||
<translation>최소 %1 자가 필요합니다!</translation>
|
||||
<translation type="vanished">최소 %1 자가 필요합니다!</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -635,20 +641,38 @@ location set</source>
|
||||
<source>openpilot</source>
|
||||
<translation>openpilot</translation>
|
||||
</message>
|
||||
<message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/util.cc" line="82"/>
|
||||
<source>%1 minute%2 ago</source>
|
||||
<translation>%1 분전</translation>
|
||||
<source>%n minute(s) ago</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/util.cc" line="85"/>
|
||||
<source>%1 hour%2 ago</source>
|
||||
<translation>%1 시간전</translation>
|
||||
<source>%n hour(s) ago</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/util.cc" line="88"/>
|
||||
<source>%n day(s) ago</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 minute%2 ago</source>
|
||||
<translation type="vanished">%1 분전</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 hour%2 ago</source>
|
||||
<translation type="vanished">%1 시간전</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/util.cc" line="88"/>
|
||||
<source>%1 day%2 ago</source>
|
||||
<translation>%1 일전</translation>
|
||||
<translation type="vanished">%1 일전</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
||||
@@ -306,10 +306,16 @@
|
||||
<source>Cancel</source>
|
||||
<translation>取消</translation>
|
||||
</message>
|
||||
<message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/widgets/input.cc" line="168"/>
|
||||
<source>Need at least %n character(s)!</source>
|
||||
<translation>
|
||||
<numerusform>至少需要 %n 个字符!</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Need at least %1 characters!</source>
|
||||
<translation>至少需要 %1 个字符!</translation>
|
||||
<translation type="vanished">至少需要 %1 个字符!</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -633,20 +639,38 @@ location set</source>
|
||||
<source>openpilot</source>
|
||||
<translation>openpilot</translation>
|
||||
</message>
|
||||
<message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/util.cc" line="82"/>
|
||||
<source>%1 minute%2 ago</source>
|
||||
<translation>%1 分钟%2 前</translation>
|
||||
<source>%n minute(s) ago</source>
|
||||
<translation>
|
||||
<numerusform>%n 分钟前</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/util.cc" line="85"/>
|
||||
<source>%1 hour%2 ago</source>
|
||||
<translation>%1 小时%2 前</translation>
|
||||
<source>%n hour(s) ago</source>
|
||||
<translation>
|
||||
<numerusform>%n 小时前</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/util.cc" line="88"/>
|
||||
<source>%n day(s) ago</source>
|
||||
<translation>
|
||||
<numerusform>%n 天前</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 minute%2 ago</source>
|
||||
<translation type="vanished">%1 分钟%2 前</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 hour%2 ago</source>
|
||||
<translation type="vanished">%1 小时%2 前</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/util.cc" line="88"/>
|
||||
<source>%1 day%2 ago</source>
|
||||
<translation>%1 天%2 前</translation>
|
||||
<translation type="vanished">%1 天%2 前</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
||||
@@ -306,10 +306,16 @@
|
||||
<source>Cancel</source>
|
||||
<translation>取消</translation>
|
||||
</message>
|
||||
<message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/widgets/input.cc" line="168"/>
|
||||
<source>Need at least %n character(s)!</source>
|
||||
<translation>
|
||||
<numerusform>需要至少 %n 個字元!</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Need at least %1 characters!</source>
|
||||
<translation>需要至少 %1 個字元!</translation>
|
||||
<translation type="vanished">需要至少 %1 個字元!</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -635,23 +641,41 @@ location set</source>
|
||||
<source>openpilot</source>
|
||||
<translation>openpilot</translation>
|
||||
</message>
|
||||
<message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/util.cc" line="82"/>
|
||||
<source>%n minute(s) ago</source>
|
||||
<translation>
|
||||
<numerusform>%n 分鐘前</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/util.cc" line="85"/>
|
||||
<source>%n hour(s) ago</source>
|
||||
<translation>
|
||||
<numerusform>%n 小時前</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../qt/util.cc" line="88"/>
|
||||
<source>%n day(s) ago</source>
|
||||
<translation>
|
||||
<numerusform>%n 天前</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 minute%2 ago</source>
|
||||
<translatorcomment>we don't need %2</translatorcomment>
|
||||
<translation>%1 分鐘前</translation>
|
||||
<translation type="vanished">%1 分鐘前</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/util.cc" line="85"/>
|
||||
<source>%1 hour%2 ago</source>
|
||||
<translatorcomment>we don't need %2</translatorcomment>
|
||||
<translation>%1 小時前</translation>
|
||||
<translation type="vanished">%1 小時前</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/util.cc" line="88"/>
|
||||
<source>%1 day%2 ago</source>
|
||||
<translatorcomment>we don't need %2</translatorcomment>
|
||||
<translation>%1 天前</translation>
|
||||
<translation type="vanished">%1 天前</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
||||
@@ -10,7 +10,10 @@ TRANSLATIONS_DIR = os.path.join(UI_DIR, "translations")
|
||||
LANGUAGES_FILE = os.path.join(TRANSLATIONS_DIR, "languages.json")
|
||||
|
||||
|
||||
def update_translations(vanish=False, translations_dir=TRANSLATIONS_DIR):
|
||||
def update_translations(vanish=False, plural_only=None, translations_dir=TRANSLATIONS_DIR):
|
||||
if plural_only is None:
|
||||
plural_only = []
|
||||
|
||||
with open(LANGUAGES_FILE, "r") as f:
|
||||
translation_files = json.load(f)
|
||||
|
||||
@@ -23,6 +26,8 @@ def update_translations(vanish=False, translations_dir=TRANSLATIONS_DIR):
|
||||
args = f"lupdate -recursive {UI_DIR} -ts {tr_file}"
|
||||
if vanish:
|
||||
args += " -no-obsolete"
|
||||
if file in plural_only:
|
||||
args += " -pluralonly"
|
||||
ret = os.system(args)
|
||||
assert ret == 0
|
||||
|
||||
@@ -31,6 +36,7 @@ if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Update translation files for UI",
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument("--vanish", action="store_true", help="Remove translations with source text no longer found")
|
||||
parser.add_argument("--plural-only", type=str, nargs="*", default=["main_en"], help="Translation codes to only create plural translations for (ie. the base language)")
|
||||
args = parser.parse_args()
|
||||
|
||||
update_translations(args.vanish)
|
||||
update_translations(args.vanish, args.plural_only)
|
||||
|
||||
Reference in New Issue
Block a user