mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
Synchronize translations
This commit is contained in:
parent
85814137ea
commit
0c2fbd178d
3
intl/.gitignore
vendored
3
intl/.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
*.json
|
*.json
|
||||||
|
crowdin.yaml
|
||||||
|
crowdin.yml
|
||||||
|
@ -15,3 +15,9 @@
|
|||||||
- No performance impact.
|
- No performance impact.
|
||||||
- Don't require translators to know how to use Git, how to read C code and how to create Pull Request.
|
- Don't require translators to know how to use Git, how to read C code and how to create Pull Request.
|
||||||
- Translators will be informed whenever a source string changes.
|
- Translators will be informed whenever a source string changes.
|
||||||
|
|
||||||
|
## Cron job setup
|
||||||
|
|
||||||
|
1. [Install crowdin cli tool](https://support.crowdin.com/cli-tool/)
|
||||||
|
2. Get the `intl/crowdin.yaml` file from someone who have crowdin admin accounts
|
||||||
|
3. Add cron job `cd path/to/retroarch/intl && ./crowin_sync.sh`
|
||||||
|
27
intl/crowdin_sync.sh
Executable file
27
intl/crowdin_sync.sh
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Update source code
|
||||||
|
git pull
|
||||||
|
|
||||||
|
# Convert source *.h to *.json
|
||||||
|
./h2json.py msg_hash_us.h
|
||||||
|
|
||||||
|
# Upload source file
|
||||||
|
crowdin upload sources
|
||||||
|
|
||||||
|
# Crowdin need some time to process data
|
||||||
|
sleep 1m
|
||||||
|
|
||||||
|
# Download translation files
|
||||||
|
crowdin download translations
|
||||||
|
|
||||||
|
# Convert translation *.json to *.h
|
||||||
|
for f in *.json
|
||||||
|
do
|
||||||
|
./json2h.py $f
|
||||||
|
done
|
||||||
|
|
||||||
|
# Commit new translations
|
||||||
|
git add .
|
||||||
|
git commit -m "Synchronize translations"
|
||||||
|
git push
|
@ -14,16 +14,11 @@ except IndexError:
|
|||||||
print("Usage: ./template.py <language_postfix>")
|
print("Usage: ./template.py <language_postfix>")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
p = re.compile('MSG_HASH\(\s*[A-Z0-9_]+,\s*\".*\"\s*\)')
|
if json_filename == 'msg_hash_us.json':
|
||||||
|
print("Skip")
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
header = """#if defined(_MSC_VER) && !defined(_XBOX) && (_MSC_VER >= 1500 && _MSC_VER < 1900)
|
p = re.compile('MSG_HASH\(\s*[A-Z0-9_]+,\s*\".*\"\s*\)')
|
||||||
#if (_MSC_VER >= 1700)
|
|
||||||
/* https://support.microsoft.com/en-us/kb/980263 */
|
|
||||||
#pragma execution_character_set("utf-8")
|
|
||||||
#endif
|
|
||||||
#pragma warning(disable:4566)
|
|
||||||
#endif
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
def parse_message(message):
|
def parse_message(message):
|
||||||
@ -53,7 +48,7 @@ def parse_messages(text):
|
|||||||
|
|
||||||
|
|
||||||
def update(messages, template):
|
def update(messages, template):
|
||||||
new_translation = header + template
|
new_translation = template
|
||||||
template_messages = parse_messages(template)
|
template_messages = parse_messages(template)
|
||||||
for tp_msg in template_messages:
|
for tp_msg in template_messages:
|
||||||
if tp_msg['key'] in messages:
|
if tp_msg['key'] in messages:
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
#if defined(_MSC_VER) && !defined(_XBOX) && (_MSC_VER >= 1500 && _MSC_VER < 1900)
|
||||||
|
#if (_MSC_VER >= 1700)
|
||||||
|
/* https://support.microsoft.com/en-us/kb/980263 */
|
||||||
|
#pragma execution_character_set("utf-8")
|
||||||
|
#endif
|
||||||
|
#pragma warning(disable:4566)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LAKKA_SWITCH
|
#ifdef HAVE_LAKKA_SWITCH
|
||||||
MSG_HASH(
|
MSG_HASH(
|
||||||
MENU_ENUM_LABEL_VALUE_SWITCH_GPU_PROFILE,
|
MENU_ENUM_LABEL_VALUE_SWITCH_GPU_PROFILE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user