Skip to content

Commit

Permalink
Merge pull request #313 from Duet3D/jp_translate
Browse files Browse the repository at this point in the history
Jp translate
  • Loading branch information
mfs12 authored Aug 31, 2023
2 parents b111900 + bd6e5f7 commit 4cc1300
Show file tree
Hide file tree
Showing 6 changed files with 529 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#endif

#define USE_CYRILLIC_CHARACTERS (1)
#define USE_JAPANESE_CHARACTERS (0)

const uint32_t DefaultBaudRate = 57600;
const uint32_t DimDisplayTimeout = 60000; // dim this display after no activity for this number of milliseconds
Expand Down
195 changes: 195 additions & 0 deletions src/Fonts/glcd19x21.cpp

Large diffs are not rendered by default.

195 changes: 195 additions & 0 deletions src/Fonts/glcd28x32.cpp

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/Hardware/UTFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,11 @@ size_t UTFT::writeNative(uint16_t c)
{
c -= 641; // Cyrillic characters are shifted down to save space
}
#elif USE_JAPANESE_CHARACTERS
else if (c >= 12352 && c <= 12543) //0x3040 - 0x309F : Hiragana(ja), 0x30A0 - 0x30FF : Katakana(ja)
{
c -= 11968; // Japanese characters are shifted down to save space
}
#endif

uint8_t ySize = cfont.y_size;
Expand Down
131 changes: 131 additions & 0 deletions src/UI/Strings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,137 @@ const StringTable LanguageTables[] =
"text length is out of range: %ld <= length <= %ld",
}
#endif
#if USE_JAPANESE_CHARACTERS
//Japanese
{
// ISO-639.1 language code
"ja",

// Main page strings
"コントロール",
"いんさつ",
"ステータス",
"コンソール",
"セットアップ",
"Current" THIN_SPACE DEGREE_SYMBOL "C",
"Active" THIN_SPACE DEGREE_SYMBOL "C",
"Standby" THIN_SPACE DEGREE_SYMBOL "C",
"いどう",
"おしだし",
"マクロ",
"ストップ",

// Print page
"Extruder" THIN_SPACE "%",
"スピード ", // note space at end
"ファン ", // note space at end
"のこりじかん: ",
"sim'd ", // note space at end
"ファイル ", // note space at end
"フィラメント ", // note space at end
"スライサー ", // note space at end
"n/a",
"ていし",
"Babystep",
"さいかい",
"キャンセル",
"プリント もういちど",
"シミュレーション もういちど",
"セット",

// Setup page
"おんりょう ", // note space at end
"タッチほせい",
"ひょうじはんてん",
"ひょうじさかさ",
"テーマ",
"あかるさ -",
"あかるさ +",
"せっていほぞん",
"せっていしょきょ",
"セーブ & リスタート",
"Info Timeout ", // note space at end
"Screensaver ", // note space at end
"Babystep ", // note space at end
"おくりそくど ", // note space at end

// Misc
"ファクトリーリセット",
"ファイルさくじょ",
"ほんとうにいいですか?",
"スポットにタッチ",
"ヘッドいどう",
"おしだしりょう (mm)",
"スピード (mm/s)",
"おしだし",
"リトラクト",
"Babystep",
"Zのオフセット: ",
"メッセージ",
"メッセージ",
"Panel Dueファームウェア ", // note space at end
"レスポンス",
"No files found",

// File popup
"カードのファイル ", // note the space on the end
"マクロ",
"エラー ", // note the space at the end
" SDカードアクセス", // note the space at the start
"ファイル: ",
"サイズ: ",
"レイヤーたかさ: ",
"オブジェクトたかさ ",
"ひつようフィラメント: ",
"スライサー: ",
"Date: ",
"よそうプリントじかん: ",
"シミュレーションプリントじかん: ",
"シミュレーション",

// Printer status strings
{
"せつぞくちゅう",
"アイドル",
"プリントちゅう",
"ていしちゅう",
"スタートアップ",
"ストップ",
"ビジー",
"いちじていし",
"さいかい",
"ファームウェアアップロード",
"ツールこうかん",
"シミュレーション",
"オフ",
"キャンセルちゅう",
},

// Theme names
{
"ライトテーマ",
"ダークテーマ 1",
"ダークテーマ 2"
},

// Display dimming types
{
"くらくしない",
"アイドルじくらく",
"つねにくらくする"
},

// Heater combine types
{
"Heat's not comb.",
"Heaters comb.",
},

"value is out of range: %ld <= value <= %ld",
"value is out of range: %f <= value <= %f",
"text length is out of range: %ld <= length <= %ld",
}
#endif
};

constexpr unsigned int NumLanguages = sizeof(LanguageTables) / sizeof(LanguageTables[0]);
Expand Down
2 changes: 2 additions & 0 deletions src/UI/UserInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,8 @@ static void CreateKeyboardPopup(uint32_t language, ColourScheme colours)
#if USE_CYRILLIC_CHARACTERS
keysEN, // Ukrainian
keysEN, // Russian
#elif USE_JAPANESE_CHARACTERS
keysEN, // Japanese
#endif
};

Expand Down

0 comments on commit 4cc1300

Please sign in to comment.