diff options
author | metamuffin <metamuffin@disroot.org> | 2024-10-06 23:02:10 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-10-06 23:02:10 +0200 |
commit | a7ae29a8257447227621efde489095ace81fd028 (patch) | |
tree | 106650baf2992661f840bc228687d471b7493609 | |
parent | de9d2e0ae8187014983fe08e25383d24b1f76d1b (diff) | |
download | hurrycurry-website-a7ae29a8257447227621efde489095ace81fd028.tar hurrycurry-website-a7ae29a8257447227621efde489095ace81fd028.tar.bz2 hurrycurry-website-a7ae29a8257447227621efde489095ace81fd028.tar.zst |
localize
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | index_template.html (renamed from index.html) | 99 | ||||
m--------- | main | 0 | ||||
-rw-r--r-- | makefile | 17 | ||||
-rw-r--r-- | translate.py | 38 |
5 files changed, 90 insertions, 66 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26d2956 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/index.*.html + diff --git a/index.html b/index_template.html index d5e8af6..d92ba84 100644 --- a/index.html +++ b/index_template.html @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en"> +<html lang="{_lang}"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> @@ -19,58 +19,24 @@ <img src="./screenshot-3.webp" alt="Screenshot" class="screenshot" /> <img src="./screenshot-4.webp" alt="Screenshot" class="screenshot" /> </div> - <p> - <b>Hurry Curry!</b> is a multiplayer game about cooking. - Your goal is to run a restaurant and gain points by serving - meals you've cooked. The game is completely free software, - licenced AGPL 3.0 only. - </p> + <p>{i.abstract}</p> - <h2>Gameplay Overview</h2> - <p> - During the game, customers will enter your restaurant and order different meals. The players task is to - assemble these meals by cutting, cooking, baking and combining resources in the kitchen. Multitasking is - crucial but can lead to food burning or customers leaving if the player takes to long. There are many - different restaurant/kitchen layouts. - </p> + <h2>{i.gameplay_overview}</h2> + <p>{i.gameplay_overview.par}</p> <a href="https://s.metamuffin.org/static/hurrycurry/trailer-flathub.webm" target="_blank"> - <img width="400px" src="https://s.metamuffin.org/static/hurrycurry/trailer-thumbnail-click.webp" alt="Hurry Curry! Gameplay Trailer"> + <img width="400px" src="https://s.metamuffin.org/static/hurrycurry/trailer-thumbnail-click.webp" + alt="Hurry Curry! Gameplay Trailer"> </a> - <h2>How to play</h2> - <p> - To play, download the game for your platform or use - <a href="https://hurrycurry-web.metamuffin.org/">the rather laggy browser version</a>. - Then connect to a server, - either locally hosted or the one we provide ("Quick - Connect"). Assemble your team of chefs in the lobby before - starting the game. When playing for the first time the - "junior" map is recommended. - </p> - <p> - The recipes can be found in the <a href="https://s.metamuffin.org/static/hurrycurry/book.pdf">Recipe - Book</a> (also available ingame in some maps). - </p> - <p> - Keyboard Controls: Move character with WASD. Move camera - with arrow keys. Interact with Space or J. Boost with Left - Shift or K. Open/close menus with Escape. Press Enter to - open chat. Reset view with R. - </p> - <p> - Controller Controls: Move character with Left Stick. Move - camera with Right Stick. Interact with A, Boost with B, - Open/close menus with Menu button. Use keyboard for chat. - Reset view with Y. - </p> - <h2>Installation</h2> + <h2>{i.how_to_play}</h2> + <p>{i.how_to_play.par}</p> + <p>{i.how_to_play.book}</p> + <p>{i.how_to_play.keyboard_controls}</p> + <p>{i.how_to_play.controller_controls}</p> - <p> - The source code repository is available on - <a href="https://codeberg.org/hurrycurry/hurrycurry/">Codeberg</a>. Prebuilt packages can be downloaded - from one of the following sources: - </p> + <h2>{i.installation}</h2> + <p>{i.installation.par}</p> <table> <tr> @@ -154,17 +120,22 @@ </tr> </table> - <a href='https://codeberg.org/hurrycurry/hurrycurry'><img height='80' alt='Get it on Codeberg' src='./badge-codeberg.png'/></a> - <a href='https://flathub.org/apps/org.metamuffin.hurrycurry.client'><img height='80' alt='Get it on Flathub' src='./badge-flathub.png'/></a> - <a href='https://metamuffin1.itch.io/hurrycurry'><img height='80' alt='Available on itch.io' src='./badge-itchio.png'/></a> - <a href="https://snapcraft.io/hurrycurry"><img height="80" alt="Get it from the Snap Store" src="./badge-snap.svg" /></a> - - <h2>Public Servers</h2> - <iframe src="https://hurrycurry-registry.metamuffin.org/v1/list" frameborder="0" style="width: 100%;"></iframe> + <a href='https://codeberg.org/hurrycurry/hurrycurry'><img height='80' alt='Get it on Codeberg' + src='./badge-codeberg.png' /></a> + <a href='https://flathub.org/apps/org.metamuffin.hurrycurry.client'><img height='80' alt='Get it on Flathub' + src='./badge-flathub.png' /></a> + <a href='https://metamuffin1.itch.io/hurrycurry'><img height='80' alt='Available on itch.io' + src='./badge-itchio.png' /></a> + <a href="https://snapcraft.io/hurrycurry"><img height="80" alt="Get it from the Snap Store" + src="./badge-snap.svg" /></a> + + <h2>{i.public_servers}</h2> + <iframe src="https://hurrycurry-registry.metamuffin.org/v1/list" frameborder="0" + style="width: 100%;"></iframe> - <h2>Credits</h2> + <h2>{i.credits}</h2> <p> - The game is primarily developed by <span id="shuffle">nokoe, metamuffin, tpart</span>. + {i.credits.primary} <script> const s = document.getElementById("shuffle"); const c = s.textContent.split(", "); @@ -174,19 +145,15 @@ } s.textContent = c.join(", ") </script> - Other contributers include Sofviic, BigBrotherNii and RustyStriker. + {i.credits.contributers} </p> - <h2>Contribute</h2> - <p>You can help make the game better by contributing code through pull requests on <a - href="https://codeberg.org/hurrycurry/hurrycurry/">Codeberg</a>.</p> - <p>You can also translate the game to your language on <a - href="https://translate.codeberg.org/engage/hurrycurry/">Codeberg's Weblate</a></p> + <h2>{i.contribute}</h2> + <p>{i.contribute.par}</p> + <p>{i.contribute.translate}</p> </div> - <footer> - Have fun! - </footer> + <footer>{i.have_fun}</footer> </article> </body> -</html> +</html>
\ No newline at end of file diff --git a/main b/main new file mode 160000 +Subproject a40aeca5d1ade9df8dfdeec7e54e57649086a3e diff --git a/makefile b/makefile new file mode 100644 index 0000000..0551493 --- /dev/null +++ b/makefile @@ -0,0 +1,17 @@ + + +noop = +space = $(noop) $(noop) +comma = , +langs = $(patsubst main/locale/%.ini,%,$(wildcard main/locale/*.ini)) + +s_langs = $(subst $(space),$(comma),$(langs)) +out = $(shell echo index.{$(s_langs)}.html) + +.PHONY: all out +all: $(out) +clean: + rm -f $(out) + +index.%.html: main/locale/%.ini main/locale/en.ini + python translate.py $(*) diff --git a/translate.py b/translate.py new file mode 100644 index 0000000..c73a364 --- /dev/null +++ b/translate.py @@ -0,0 +1,38 @@ +import re +import sys + +lang = sys.argv[1] + +trmap = { + '_a_browser_version': '<a href="https://hurrycurry-web.metamuffin.org/">', + '_a_book': '<a href="https://s.metamuffin.org/static/hurrycurry/book.pdf">', + '_a_codeberg': '<a href="https://codeberg.org/hurrycurry/hurrycurry/">', + '_a_weblate': '<a href="https://translate.codeberg.org/engage/hurrycurry/">', + '_a_end': '</a>', + '_b': '<b>', + '_b_end': '</b>', + '_developers': '<span id="shuffle">nokoe, metamuffin, tpart</span>', + '_lang': lang, +} +for l in ["en", lang]: + for line in open(f"main/locale/{l}.ini"): + line = line.strip() + if line == "[hurrycurry]": continue + if line == "": continue + key, value = line.split("=") + trmap[key.strip()] = value.strip().replace("<","<").replace(">",">") + +s = open("index_template.html").read() + +def replace(matches): + x = matches.group(1) + if x in trmap: x = trmap[x] + else: x = f"MISSING TR ({x})" + return x + +while True: + sb = s + s = re.sub(r"\{([\w\.]+)\}", replace, s) + if s == sb: break + +open(f"index.{lang}.html","w+").write(s) |