Commit c6dc4ae7 authored by lunasorcery's avatar lunasorcery
Browse files

move all english text into localization system

parent 99d28608
...@@ -20,14 +20,27 @@ def crc32_file(filename): ...@@ -20,14 +20,27 @@ def crc32_file(filename):
return f"{buf:08x}" return f"{buf:08x}"
# WIP features # WIP language feature
enableLanguageDropdown = False enableLanguageDropdown = False
validateMissingLocalization = True validateMissingLocalization = True
# Seasonal events
meteorikJurorApplicationOpen = False
meteorikPublicNominationsOpen = False
# load languages
with open('languages/list.json') as file: with open('languages/list.json') as file:
languages = json.load(file) languages = [lang for lang in json.load(file) if lang.get('visible', True)]
# enumerate translators
translators = []
for lang in languages:
for translator in lang.get('translators', []):
translators.append(translator)
# load prods # load prods
with open('prods.json') as file: with open('prods.json') as file:
...@@ -144,11 +157,12 @@ sharedTemplate = { ...@@ -144,11 +157,12 @@ sharedTemplate = {
'current-year': datetime.datetime.now().year, 'current-year': datetime.datetime.now().year,
'meteoriks-juror-application-open': False, 'meteoriks-juror-application-open': meteorikJurorApplicationOpen,
'meteoriks-nominations-open': False, 'meteoriks-nominations-open': meteorikPublicNominationsOpen,
'enable-language-dropdown': enableLanguageDropdown, 'enable-language-dropdown': enableLanguageDropdown,
'languages': languages, 'languages': languages,
'translators': ', '.join(sorted(translators)),
'external-url-meteoriks': 'https://meteoriks.org/', 'external-url-meteoriks': 'https://meteoriks.org/',
'external-url-meteoriks-jurors': 'https://meteoriks.org/taking_part/juror', 'external-url-meteoriks-jurors': 'https://meteoriks.org/taking_part/juror',
...@@ -180,7 +194,7 @@ for lang in languages: ...@@ -180,7 +194,7 @@ for lang in languages:
if key not in value: if key not in value:
if validateMissingLocalization: if validateMissingLocalization:
print(f"ERROR: Missing i18n key '{text}' for language '{lang['name']}'") print(f"ERROR: Missing i18n key '{text}' for language '{lang['name']}'")
quit() quit(1)
else: else:
return f"[[{text.strip()}]]" return f"[[{text.strip()}]]"
value = value[key] value = value[key]
......
...@@ -18,10 +18,19 @@ ...@@ -18,10 +18,19 @@
"meteoriks": { "meteoriks": {
"what-are-meteoriks": "What are the Meteoriks?", "what-are-meteoriks": "What are the Meteoriks?",
"what-are-meteoriks-p1": "<a href=\"{{external-url-meteoriks}}\">The Meteoriks</a> are an award to honor the best productions that the demoscene has to offer, and are presented annually at the Revision demoparty over the Easter weekend.", "what-are-meteoriks-p1": "<a href=\"{{external-url-meteoriks}}\">The Meteoriks</a> are an award to honor the best productions that the demoscene has to offer, and are presented annually at the Revision demoparty over the Easter weekend.",
"what-are-meteoriks-p2": "Following a surge of activity in the Executable Graphics field, the Meteoriks introduced a category for Best Executable Graphics in 2021. You can see the nominees and winner below." "what-are-meteoriks-p2": "Following a surge of activity in the Executable Graphics field, the Meteoriks introduced a category for Best Executable Graphics in 2021. You can see the nominees and winner below.",
"juror-application-open": "Applications to be a juror for the {{current-year}} Meteoriks are <a href=\"{{external-url-meteoriks-jurors}}\">now open</a>!",
"public-nominations-open": "Public nominations for the {{current-year}} Meteoriks are now open - you can submit entries for the jurors' consideration through both <a href=\"{{external-url-pouet}}\">Pouët</a> and <a href=\"{{external-url-demozoo}}\">Demozoo</a>."
}, },
"about": { "about": {
"what-is-exegfx": "What is Executable Graphics?", "what-is-exegfx": "What is Executable Graphics?",
"what-is-exe-dot-gfx": "What is executable.graphics?" "what-is-exegfx-p1": "In the purest sense, Executable Graphics is visual artwork through the medium of software. Each artwork is created not as an image file, but as an executable program which, when run, renders the artwork in-the-moment.",
"what-is-exegfx-p2": "While the popular demoscene demo/intro formats produce realtime animated visuals and music, Executable Graphics produces only a single still image, with more time for rendering. This allows for more computationally intensive rendering techniques that cannot be run in realtime.",
"what-is-exegfx-p3": "Over the last decade or so, demoparties have popularized the 4K Executable Graphics format. Make no mistake, '4K' here refers to the filesize, not the resolution - each entry to these competitions cannot exceed 4 kilobytes (4096 bytes) in size.",
"what-is-exe-dot-gfx": "What is executable.graphics?",
"what-is-exe-dot-gfx-p1": "This website presents a gallery of artworks from various artists in the Executable Graphics scene. Each piece in the collection was rendered by an executable no larger than 4096 bytes.",
"what-is-exe-dot-gfx-p2": "You are invited to browse the collection as you would an art gallery - to spend time with each piece, and to consider the craft (both artistic and technical) behind each.",
"credit-curator": "This collection is curated by yx.",
"credit-translators": "Localization by {{translators}}."
} }
} }
{
"comment": "NOTE: this is all placeholder google translate, replace it with a real translation before setting the feature live!",
"global": {
"toggle-theme": "テーマを切り替える",
"toggle-lang": "言語"
},
"nav": {
"gallery": "ギャラリー",
"meteoriks": "メテオリック",
"about": "約"
},
"artwork": {
"platform": "{{platform}} 実行可能ファイル"
},
"badges": {
"meteorik-nominee": "メテオリック {{meteorik-year}} の候補者",
"meteorik-winner": "メテオリック {{meteorik-year}} 優勝"
},
"meteoriks": {
"what-are-meteoriks": "メテオリックとは?",
"what-are-meteoriks-p1": "<a href=\"{{external-url-meteoriks}}\">Meteoriks は</a>、デモシーンが提供しなければならない最高の作品を表彰する賞であり、イースターの週末にリビジョン デモパーティーで毎年発表されます。",
"what-are-meteoriks-p2": "Executable Graphics カテゴリでの活動が急増した後、Meteoriks は 2021 年に Best Executable Graphics のカテゴリを導入しました。以下にノミネートと受賞者を示します。"
},
"about": {
"what-is-exegfx": "実行可能なグラフィックスとは何ですか?",
"what-is-exe-dot-gfx": "executable.graphics とは何ですか?"
}
}
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
{ {
"id": "jp", "id": "jp",
"name": "日本語", "name": "日本語",
"root": "/jp" "root": "/jp",
"visible": false,
"translators": [
"YOUR HANDLE HERE"
]
} }
] ]
\ No newline at end of file
...@@ -4,32 +4,19 @@ ...@@ -4,32 +4,19 @@
<div class="text"> <div class="text">
<span class="question">{{#i18n}}about.what-is-exegfx{{/i18n}}</span> <span class="question">{{#i18n}}about.what-is-exegfx{{/i18n}}</span>
<div class="answer"> <div class="answer">
<p> <p>{{#i18n}}about.what-is-exegfx-p1{{/i18n}}</p>
In the purest sense, Executable Graphics is visual artwork through the medium of software. <p>{{#i18n}}about.what-is-exegfx-p2{{/i18n}}</p>
Each artwork is created not as an image file, but as an executable program which, when run, renders the artwork in-the-moment. <p>{{#i18n}}about.what-is-exegfx-p3{{/i18n}}</p>
</p>
<p>
While the popular demoscene demo/intro formats produce realtime animated visuals and music, Executable Graphics produces only a single still image, with more time for rendering.
This allows for more computationally intensive rendering techniques that cannot be run in realtime.
</p>
<p>
Over the last decade or so, demoparties have popularized the 4K Executable Graphics format.
Make no mistake, '4K' here refers to the filesize, not the resolution - each entry to these competitions cannot exceed 4 kilobytes (4096 bytes) in size.
</p>
</div> </div>
<br/> <br/>
<span class="question">{{#i18n}}about.what-is-exe-dot-gfx{{/i18n}}</span> <span class="question">{{#i18n}}about.what-is-exe-dot-gfx{{/i18n}}</span>
<div class="answer"> <div class="answer">
<p> <p>{{#i18n}}about.what-is-exe-dot-gfx-p1{{/i18n}}</p>
This website presents a gallery of artworks from various artists in the Executable Graphics scene. <p>{{#i18n}}about.what-is-exe-dot-gfx-p2{{/i18n}}</p>
Each piece in the collection was rendered by an executable no larger than 4096 bytes. <p>{{#i18n}}about.credit-curator{{/i18n}}</p>
</p> {{#enable-language-dropdown}}
<p> <p>{{#i18n}}about.credit-translators{{/i18n}}</p>
You are invited to browse the collection as you would an art gallery - to spend time with each piece, and to consider the craft (both artistic and technical) behind each. {{/enable-language-dropdown}}
</p>
<p>
This collection is curated by yx.
</p>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
<meta charset="utf-8"/> <meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
<title>{{meta-title}}{{#meta-subtitle}} | {{meta-subtitle}}{{/meta-subtitle}}</title> <title>{{#meta-subtitle}}{{meta-subtitle}} | {{/meta-subtitle}}{{meta-title}}</title>
<meta property="og:title" content="{{meta-title}}{{#meta-subtitle}} | {{meta-subtitle}}{{/meta-subtitle}}"/> <meta property="og:title" content="{{#meta-subtitle}}{{meta-subtitle}} | {{/meta-subtitle}}{{meta-title}}"/>
<meta name="twitter:title" content="{{meta-title}}{{#meta-subtitle}} | {{meta-subtitle}}{{/meta-subtitle}}"/> <meta name="twitter:title" content="{{#meta-subtitle}}{{meta-subtitle}} | {{/meta-subtitle}}{{meta-title}}"/>
<meta name="apple-mobile-web-app-title" content="exe.gfx"/> <meta name="apple-mobile-web-app-title" content="exe.gfx"/>
<link rel="manifest" href="/manifest.json?cache={{hash-manifest-json}}"/> <link rel="manifest" href="/manifest.json?cache={{hash-manifest-json}}"/>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<link href="/style.css?cache={{hash-style-css}}" rel="stylesheet"/> <link href="/style.css?cache={{hash-style-css}}" rel="stylesheet"/>
</head> </head>
<body> <body>
{{#enable-language-dropdown}} {{#enable-language-dropdown}}
<div class="switch switch-left switch-dropdown" id="switch-lang" tabindex="0"> <div class="switch switch-left switch-dropdown" id="switch-lang" tabindex="0">
<label class="label"> <label class="label">
{{{svg-globe}}} {{{svg-globe}}}
...@@ -37,13 +37,13 @@ ...@@ -37,13 +37,13 @@
</label> </label>
<div class="mousetrap"> <div class="mousetrap">
<ul class="dropdown"> <ul class="dropdown">
{{#languages}} {{#languages}}
<a href="{{root}}/{{currpage-canonical-filename}}" class="item" tabindex="0">{{name}}</a> <a href="{{root}}/{{currpage-canonical-filename}}" class="item" tabindex="0">{{name}}</a>
{{/languages}} {{/languages}}
</ul> </ul>
</div> </div>
</div> </div>
{{/enable-language-dropdown}} {{/enable-language-dropdown}}
<div class="navbar"> <div class="navbar">
<a href="." class="entry{{#page-gallery}} active{{/page-gallery}}">{{#i18n}}nav.gallery{{/i18n}}</a> <a href="." class="entry{{#page-gallery}} active{{/page-gallery}}">{{#i18n}}nav.gallery{{/i18n}}</a>
<a href="meteoriks.html" class="entry{{#page-meteoriks}} active{{/page-meteoriks}}">{{#i18n}}nav.meteoriks{{/i18n}}</a> <a href="meteoriks.html" class="entry{{#page-meteoriks}} active{{/page-meteoriks}}">{{#i18n}}nav.meteoriks{{/i18n}}</a>
......
...@@ -6,16 +6,12 @@ ...@@ -6,16 +6,12 @@
<div class="answer"> <div class="answer">
<p>{{#i18n}}meteoriks.what-are-meteoriks-p1{{/i18n}}</p> <p>{{#i18n}}meteoriks.what-are-meteoriks-p1{{/i18n}}</p>
<p>{{#i18n}}meteoriks.what-are-meteoriks-p2{{/i18n}}</p> <p>{{#i18n}}meteoriks.what-are-meteoriks-p2{{/i18n}}</p>
{{#meteoriks-juror-application-open}} {{#meteoriks-juror-application-open}}
<p> <p>{{#i18n}}meteoriks.juror-application-open{{/i18n}}</p>
Applications to be a juror for the {{current-year}} Meteoriks are <a href="{{external-url-meteoriks-jurors}}">now open</a>! {{/meteoriks-juror-application-open}}
</p> {{#meteoriks-nominations-open}}
{{/meteoriks-juror-application-open}} <p>{{#i18n}}meteoriks.public-nominations-open{{/i18n}}</p>
{{#meteoriks-nominations-open}} {{/meteoriks-nominations-open}}
<p>
Public nominations for the {{current-year}} Meteoriks are now open - you can submit entries for the jurors' consideration through both <a href="{{external-url-pouet}}">Pouët</a> and <a href="{{external-url-demozoo}}">Demozoo</a>.
</p>
{{/meteoriks-nominations-open}}
</div> </div>
</div> </div>
</div> </div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment