Skip to content

Commit

Permalink
feat(core/translations): add it, pt, tr
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilata committed Jul 22, 2024
1 parent cf69a3c commit c2e8e61
Show file tree
Hide file tree
Showing 72 changed files with 16,582 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- id: set_vars
name: Set variables
run: |
echo test_lang=${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'translations') && '[\"en\", \"cs\", \"fr\", \"de\", \"es\"]' || '[\"en\"]' }} >> $GITHUB_OUTPUT
echo test_lang=${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'translations') && '[\"en\", \"cs\", \"fr\", \"de\", \"es\", \"it\", \"pt\", \"tr\"]' || '[\"en\"]' }} >> $GITHUB_OUTPUT
echo asan=${{ github.event_name == 'schedule' && '[\"noasan\", \"asan\"]' || '[\"noasan\"]' }} >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
Expand Down
1 change: 1 addition & 0 deletions core/.changelog.d/noissue.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Italian, Portugese, and Turkish translations.
2 changes: 2 additions & 0 deletions core/embed/lib/fonts/font_pixeloperatormono_regular_8.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>

// clang-format off
Expand Down
2 changes: 2 additions & 0 deletions core/embed/lib/fonts/font_robotomono_medium_21.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>

// clang-format off
Expand Down
2 changes: 2 additions & 0 deletions core/embed/lib/fonts/font_robotomono_medium_21.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>

#if TREZOR_FONT_BPP != 4
Expand Down
2 changes: 2 additions & 0 deletions core/embed/lib/fonts/font_ttsatoshi_demibold_42.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>

// clang-format off
Expand Down
2 changes: 2 additions & 0 deletions core/embed/lib/fonts/font_ttsatoshi_demibold_42.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>

#if TREZOR_FONT_BPP != 4
Expand Down
2 changes: 2 additions & 0 deletions core/embed/lib/fonts/font_unifont_bold_16.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>

#if TREZOR_FONT_BPP != 1
Expand Down
2 changes: 2 additions & 0 deletions core/embed/lib/fonts/font_unifont_regular_16.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>

// clang-format off
Expand Down
2 changes: 2 additions & 0 deletions core/embed/lib/fonts/font_unifont_regular_16.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>

#if TREZOR_FONT_BPP != 1
Expand Down
53 changes: 53 additions & 0 deletions core/tools/codegen/foreign_chars.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,62 @@
"ü",
)

italian_chars = (
"À"
"à"
"è"
"é"
"ì"
"ò"
"ù"
)


portugese_chars = (
"º"
"Á"
"Ã"
"Ç"
"Í"
"Ó"
"Õ"
"Ú"
"à"
"á"
"ã"
"ç"
"é"
"ê"
"í"
"ó"
"ô"
"õ"
"ú"
)


turkish_chars = (
"Ç"
"Ö"
"Ü"
"ç"
"ö"
"ü"
"Ğ"
"ğ"
"İ"
"ı"
"Ş"
"ş"
)


all_languages = {
"cs": czech_chars,
"fr": french_chars,
"es": spanish_chars,
"de": german_chars,
"it": italian_chars,
"pt": portugese_chars,
"tr": turkish_chars,
}
3 changes: 3 additions & 0 deletions core/tools/codegen/gen_font.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ def _normalize(s: str) -> str:
"Ä",
"À",
"Â",
"Ã",
"Æ",
"Î",
"Ï",
"Ì",
"î",
"ï",
"ì",
"ÿ",
"Ý",
"Ÿ",
Expand Down
2 changes: 1 addition & 1 deletion core/tools/translations/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
TRANSLATIONS_DIR = CORE / "translations"

ENGLISH_LANG = "en"
FOREIGN_LANGUAGES = ["cs", "de", "es", "fr"]
FOREIGN_LANGUAGES = ["cs", "de", "es", "fr", "it", "pt", "tr"]
ALL_LANGUAGES = [ENGLISH_LANG] + FOREIGN_LANGUAGES
11 changes: 11 additions & 0 deletions core/translations/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,17 @@ def merge(update_json: t.Tuple[t.TextIO, ...]) -> None:
tdir.save_lang(lang, orig_data)
click.echo(f"Updated {lang}")

@cli.command()
@click.argument("lang_file", type=click.File("r"), nargs=1)
def characters(lang_file: t.TextIO) -> None:
"""Extract all non-ASCII characters."""
all_chars = set(lang_file.read())
chars = filter(lambda c: ord(c) > 127, all_chars)
print("(")
for c in sorted(chars):
print(f" \"{c}\"")
print(")")


if __name__ == "__main__":
cli()
9 changes: 9 additions & 0 deletions core/translations/fonts/font_pixeloperator_bold_8_it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"À": "060707000760c7b3cffcc0",
"à": "060707000760c7837f37c0",
"è": "060707000760c7b3ff0780",
"é": "060707000718c7b3ff0780",
"ì": "0307050007cc36d8",
"ò": "060707000760c7b3cf3780",
"ù": "060707000760ccf3cf3780"
}
21 changes: 21 additions & 0 deletions core/translations/fonts/font_pixeloperator_bold_8_pt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"o": "06050700057b3cf378",
"Á": "060707000718c7b3cffcc0",
"Ã": "070707000777b9e66cdfb300",
"Ç": "06080700077b3c30cde19c00",
"Í": "0307050107786db0",
"Ó": "060707000718c7b3cf3780",
"Õ": "070707000777b9e66cd99e00",
"Ú": "060707000718ccf3cf3780",
"à": "060707000760c7837f37c0",
"á": "060707000718c7837f37c0",
"ã": "070707000777b9e067d99f00",
"ç": "06080700077b3c3378c19c00",
"é": "060707000718c7b3ff0780",
"ê": "0707070007fd0de66fd81e00",
"í": "0307050107786db0",
"ó": "060707000718c7b3cf3780",
"ô": "0707070007fd0de66cd99e00",
"õ": "070707000777b9e66cd99e00",
"ú": "060707000718ccf3cf3780"
}
14 changes: 14 additions & 0 deletions core/translations/fonts/font_pixeloperator_bold_8_tr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Ç": "06080700077b3c30cde19c00",
"Ö": "0607070007cc07b3cf3780",
"Ü": "0607070007cc0cf3cf3780",
"ç": "06080700077b3c3378c19c00",
"ö": "0607070007cc07b3cf3780",
"ü": "0607070007cc0cf3cf3780",
"Ğ": "0507080107fc6318c7e0",
"ğ": "0507080107fc6318c7e0",
"İ": "0507080107fc6318c7e0",
"ı": "0205050105ffc0",
"Ş": "0507080107fc6318c7e0",
"ş": "0507080107fc6318c7e0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"À": "060707000760c7b3cffcc0",
"à": "060707000760c7b3cffcc0",
"è": "060707000760cff0f30fc0",
"é": "060707000718cff0f30fc0",
"ì": "0307050007cc36d8",
"ò": "060707000760c7b3cf3780",
"ù": "060707000760ccf3cf3780"
}
21 changes: 21 additions & 0 deletions core/translations/fonts/font_pixeloperator_bold_8_upper_pt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"o": "06070700077b3cf3cf3780",
"Á": "060707000718c7b3cffcc0",
"Ã": "070707000777b9e66cdfb300",
"Ç": "06080700077b3c30cde19c00",
"Í": "0307050107786db0",
"Ó": "060707000718c7b3cf3780",
"Õ": "070707000777b9e66cd99e00",
"Ú": "060707000718ccf3cf3780",
"à": "060707000760c7b3cffcc0",
"á": "060707000718c7b3cffcc0",
"ã": "070707000777b9e66cdfb300",
"ç": "06080700077b3c30cde19c00",
"é": "060707000718cff0f30fc0",
"ê": "06070700077b3ff0f30fc0",
"í": "0307050107786db0",
"ó": "060707000718c7b3cf3780",
"ô": "0707070007fd0de66cd99e00",
"õ": "070707000777b9e66cd99e00",
"ú": "060707000718ccf3cf3780"
}
14 changes: 14 additions & 0 deletions core/translations/fonts/font_pixeloperator_bold_8_upper_tr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Ç": "06080700077b3c30cde19c00",
"Ö": "0607070007cc07b3cf3780",
"Ü": "0607070007cc0cf3cf3780",
"ç": "06080700077b3c30cde19c00",
"ö": "0607070007cc07b3cf3780",
"ü": "0607070007cc0cf3cf3780",
"Ğ": "0507080107fc6318c7e0",
"ğ": "0507080107fc6318c7e0",
"İ": "0507080107fc6318c7e0",
"ı": "0207050107fffc",
"Ş": "0507080107fc6318c7e0",
"ş": "0507080107fc6318c7e0"
}
9 changes: 9 additions & 0 deletions core/translations/fonts/font_pixeloperator_regular_8_it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"À": "0507060007411d18fe20",
"à": "0507060007411c17c5e0",
"è": "0507060007411d1fc1c0",
"é": "0507060007111d1fc1c0",
"ì": "02070400079154",
"ò": "0507060007411d18c5c0",
"ù": "0507060007412318c5c0"
}
21 changes: 21 additions & 0 deletions core/translations/fonts/font_pixeloperator_regular_8_pt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"o": "050506000574631700",
"Á": "0507060007111d18fe20",
"Ã": "06070600076667228be880",
"Ç": "0508060007746108b84c00",
"Í": "020704010762a8",
"Ó": "0507060007111d18c5c0",
"Õ": "06070600076667228a2700",
"Ú": "0507060007112318c5c0",
"à": "0507060007411c17c5e0",
"á": "0507060007111c17c5e0",
"ã": "06070600076667027a2780",
"ç": "0508060007746117104c00",
"é": "0507060007111d1fc1c0",
"ê": "0507060007229d1fc1c0",
"í": "020704010762a8",
"ó": "0507060007111d18c5c0",
"ô": "0507060007229d18c5c0",
"õ": "06070600076667228a2700",
"ú": "0507060007112318c5c0"
}
14 changes: 14 additions & 0 deletions core/translations/fonts/font_pixeloperator_regular_8_tr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Ç": "0508060007746108b84c00",
"Ö": "0507060007501d18c5c0",
"Ü": "0507060007502318c5c0",
"ç": "0508060007746117104c00",
"ö": "0507060007501d18c5c0",
"ü": "0507060007502318c5c0",
"Ğ": "0507080107fc6318c7e0",
"ğ": "0507080107fc6318c7e0",
"İ": "0507080107fc6318c7e0",
"ı": "0105040105f8",
"Ş": "0507080107fc6318c7e0",
"ş": "0507080107fc6318c7e0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"À": "0507060007411d18fe20",
"à": "0507060007411d18fe20",
"è": "0507060007413f0e43e0",
"é": "0507060007113f0e43e0",
"ì": "02070400079154",
"ò": "0507060007411d18c5c0",
"ù": "0507060007412318c5c0"
}
21 changes: 21 additions & 0 deletions core/translations/fonts/font_pixeloperator_regular_8_upper_pt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"o": "0507060007746318c5c0",
"Á": "0507060007111d18fe20",
"Ã": "06070600076667228be880",
"Ç": "0508060007746108b84c00",
"Í": "020704010762a8",
"Ó": "0507060007111d18c5c0",
"Õ": "06070600076667228a2700",
"Ú": "0507060007112318c5c0",
"à": "0507060007411d18fe20",
"á": "0507060007111d18fe20",
"ã": "06070600076667228be880",
"ç": "0508060007746108b84c00",
"é": "0507060007113f0e43e0",
"ê": "050706000722bf0e43e0",
"í": "020704010762a8",
"ó": "0507060007111d18c5c0",
"ô": "0507060007229d18c5c0",
"õ": "06070600076667228a2700",
"ú": "0507060007112318c5c0"
}
14 changes: 14 additions & 0 deletions core/translations/fonts/font_pixeloperator_regular_8_upper_tr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Ç": "0508060007746108b84c00",
"Ö": "0507060007501d18c5c0",
"Ü": "0507060007502318c5c0",
"ç": "0508060007746108b84c00",
"ö": "0507060007501d18c5c0",
"ü": "0507060007502318c5c0",
"Ğ": "0507080107fc6318c7e0",
"ğ": "0507080107fc6318c7e0",
"İ": "0507080107fc6318c7e0",
"ı": "0107040107fe",
"Ş": "0507080107fc6318c7e0",
"ş": "0507080107fc6318c7e0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"À": "0507070007411d18fe20",
"à": "0507070007411c17c5e0",
"è": "0507070007411d1fc1c0",
"é": "0507070007111d1fc1c0",
"ì": "050707000741384213e0",
"ò": "0507070007411d18c5c0",
"ù": "0507070007412318c5c0"
}
21 changes: 21 additions & 0 deletions core/translations/fonts/font_pixeloperatormono_regular_8_pt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"o": "050507000574631700",
"Á": "0507070007111d18fe20",
"Ã": "06070700076667228be880",
"Ç": "0508070007746108b84c00",
"Í": "0507070007113e4213e0",
"Ó": "0507070007111d18c5c0",
"Õ": "06070700076667228a2700",
"Ú": "0507070007112318c5c0",
"à": "0507070007411c17c5e0",
"á": "0507070007111c17c5e0",
"ã": "06070700076667027a2780",
"ç": "0508070007746117104c00",
"é": "0507070007111d1fc1c0",
"ê": "0507070007229d1fc1c0",
"í": "050707000711384213e0",
"ó": "0507070007111d18c5c0",
"ô": "0507070007229d18c5c0",
"õ": "06070700076667228a2700",
"ú": "0507070007112318c5c0"
}
14 changes: 14 additions & 0 deletions core/translations/fonts/font_pixeloperatormono_regular_8_tr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Ç": "0508070007746108b84c00",
"Ö": "0507070007501d18c5c0",
"Ü": "0507070007502318c5c0",
"ç": "0508070007746117104c00",
"ö": "0507070007501d18c5c0",
"ü": "0507070007502318c5c0",
"Ğ": "0507070007fc6318c7e0",
"ğ": "0507070007fc6318c7e0",
"İ": "0507070007fc6318c7e0",
"ı": "0505070005e1084f80",
"Ş": "0507070007fc6318c7e0",
"ş": "0507070007fc6318c7e0"
}
Loading

0 comments on commit c2e8e61

Please sign in to comment.