mirror of
https://github.com/libretro/RetroArch
synced 2024-12-26 21:29:08 +00:00
(Bug fix) Fix the weird 'empty translations' & correct backslash escaping in translation strings (#14609)
* (Bug fix) Fix the weird 'empty translations' & correct backslash escaping in translation strings * Update crowdin workflows GitHub is deprecating Node.js 12, so some actions need to be updated to ensure functionality into the future.
This commit is contained in:
parent
a73e1beb1c
commit
648b0ab7b7
11
.github/workflows/crowdin-daily.yml
vendored
11
.github/workflows/crowdin-daily.yml
vendored
@ -16,13 +16,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Java JDK
|
||||
uses: actions/setup-java@v1
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 1.8
|
||||
java-version: 18
|
||||
distribution: zulu
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
- name: Crowdin Sync
|
||||
shell: bash
|
||||
env:
|
||||
|
11
.github/workflows/crowdin.yml
vendored
11
.github/workflows/crowdin.yml
vendored
@ -18,13 +18,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Java JDK
|
||||
uses: actions/setup-java@v1
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 1.8
|
||||
java-version: 18
|
||||
distribution: zulu
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
- name: Crowdin Sync
|
||||
shell: bash
|
||||
env:
|
||||
|
@ -88,8 +88,10 @@ def update(messages, template, source_messages):
|
||||
if tp_msg['key'] in messages and messages[tp_msg['key']] != source_messages[tp_msg['key']]:
|
||||
tp_msg_val = tp_msg['val']
|
||||
tl_msg_val = messages[tp_msg['key']]
|
||||
# escape: reduce \\ -> \ (prevents 'over-expansion': \\ -> \\\\), then expand all \ -> \\
|
||||
tl_msg_val = tl_msg_val.replace('\\\\', '\\').replace('\\', '\\\\')
|
||||
# escape all \
|
||||
tl_msg_val = tl_msg_val.replace('\\', r'\\')
|
||||
# remove "double-dipping" on escape sequences
|
||||
tl_msg_val = re.sub(r'\\\\(?=[nrt])', r'\\', tl_msg_val)
|
||||
# escape other symbols
|
||||
tl_msg_val = tl_msg_val.replace('"', '\\\"').replace('\n', '')
|
||||
if tp_msg['key'].find('_QT_') < 0:
|
||||
|
Loading…
Reference in New Issue
Block a user