Bring languages into the tree (#1625)
* translations: bring languages into tree * Update translation phrases changed since 2021 * Update packaging script to include all translations * Update languages.cfg * Add Latin American Spanish translations This is a copy of spanish for now. * Ignore "en" when looking for translation folders English is the default and doesn't use a subfolder. * Only add each translation folder once Korean "ko" is in there twice. * Compare language coverage to english All phrases are compared to the english baseline files and any differences are reported. The differences are pushed to a Github Project as well for an easier overview. Thank you to @nosoop for sharing the Python SMC parser! * Add link to README --------- Co-authored-by: Peace-Maker <[email protected]>
This commit is contained in:
co-authored by
Peace-Maker
parent
d8fd60b562
commit
48150e0c7a
@@ -1,5 +1,6 @@
|
||||
# vim: set ts=8 sts=2 sw=2 tw=99 et ft=python:
|
||||
import os
|
||||
import re
|
||||
|
||||
builder.SetBuildFolder('package')
|
||||
|
||||
@@ -126,3 +127,17 @@ helpers.CopyFiles('plugins/basevotes', 'addons/sourcemod/scripting/basevotes')
|
||||
helpers.CopyFiles('plugins/basebans', 'addons/sourcemod/scripting/basebans')
|
||||
helpers.CopyFiles('plugins/funcommands', 'addons/sourcemod/scripting/funcommands')
|
||||
helpers.CopyFiles('plugins/playercommands', 'addons/sourcemod/scripting/playercommands')
|
||||
|
||||
with open(os.path.join(builder.sourcePath, 'configs/languages.cfg'), 'r') as f:
|
||||
language_re = re.compile(r'^\s*"([^"]+)"\s+"[^"]+"')
|
||||
added_languages = set(["en"])
|
||||
for line in f.read().splitlines():
|
||||
match = language_re.match(line)
|
||||
if match:
|
||||
lang_code = match.group(1)
|
||||
if lang_code in added_languages:
|
||||
continue
|
||||
output_path = os.path.join('addons/sourcemod/translations', lang_code)
|
||||
helpers.CreateFolders([output_path])
|
||||
helpers.CopyFiles(os.path.join('translations', lang_code), output_path)
|
||||
added_languages.add(lang_code)
|
||||
|
||||
Reference in New Issue
Block a user