Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
locale
Browse files Browse the repository at this point in the history
Rinary1 committed Oct 30, 2024
1 parent 1d7d3ce commit 196c5b3
Showing 4 changed files with 59 additions and 41 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/validate-locale.yml
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ on:
push:
branches: [ staging, trying ]
pull_request:
types: [opened, synchronize, reopened]
paths:
- '**.yml'
- '**.ftl'
@@ -12,6 +13,7 @@ jobs:
validate_ymls:
name: Validate Locales
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3.6.0
- name: Set up Python
Original file line number Diff line number Diff line change
@@ -114,3 +114,19 @@ ent-PlushieNara = На-Ра
.desc = Из дормиториев только что вышел нуарный унатх.
ent-PlushiePeacemaker = Миротворец
.desc = Там где он, там мир, но там где война, там он несëт смерть.
ent-PlushieEblan = Плюшевый Милос-Танака
.desc = Защитник станции, всегда готовый к неожиданным приключениям!
ent-PlushieKlim = Плюшевый Клим Кузьмин
.desc = Вульпа атмос, от него пахнет плазмой. Заделает любую дыру, даже в вашем сердце.
ent-PlushieMelania = Плюшевая Мелания Киселёва
.desc = Величайшая желешка во вселенной, любящая своих сестер. Хлюп!
ent-PlushieOkobius = Плюшевый Окобиус Акватика
.desc = Один из худших бригмедиков, что когда либо существовали.
ent-PlushieVyacheslav = Плюшевый Вячеслав Некрасов
.desc = Популярная в соответствующих кругах личность.
ent-PlushieLu = Плюшевый Лу'Сайм
.desc = Вы думаете, это вульпа-химик - женщина? Думайте так дальше... Иногда фыркает
ent-PlushieAgata = Плюшеывый агент Агата Кацухиро
.desc = Эта плюшка была сделана на планетарной тюрьме, осуждёнными агентами Синдиката. Носи её с гордостью, корпорат
ent-PlushieMilosTanka = Плюшевый Милос-Танака
.desc = Унати в форме Центрального Командования, что он может в себе скрывать кроме двух ножей и револьвера?
32 changes: 16 additions & 16 deletions Resources/Prototypes/_Sunrise/Entities/Objects/Fun/toys.yml
Original file line number Diff line number Diff line change
@@ -700,8 +700,8 @@
- type: entity
parent: BasePlushie
id: PlushieEblan
name: Плюшевый Милос-Танака
description: Защитник станции, всегда готовый к неожиданным приключениям!
name: Plush Milos-Tanaka
description: Protector of the station, always ready for unexpected adventures!
components:
- type: Sprite
state: plushie-eblan
@@ -710,8 +710,8 @@
- type: entity
parent: BasePlushie
id: PlushieKlim
name: Плюшевый Клим Кузьмин
description: Вульпа атмос, от него пахнет плазмой. Заделает любую дыру, даже в вашем сердце.
name: Plush Klim Kuzmin
description: Vulpa atm, he smells like plasma. It'll fix any hole, even in your heart.
components:
- type: Sprite
state: plushie-klim
@@ -720,8 +720,8 @@
- type: entity
parent: BasePlushie
id: PlushieMelania
name: Плюшевая Мелания Киселёва
description: Величайшая желешка во вселенной, любящая своих сестер. Хлюп!
name: Plush Melania Kiseleva
description: The greatest jellybean in the universe, loving her sisters. Squish!
components:
- type: Sprite
state: plushie-melania
@@ -730,8 +730,8 @@
- type: entity
parent: BasePlushie
id: PlushieOkobius
name: Плюшевый Окобиус Акватика
description: Один из худших бригмедиков, что когда либо существовали.
name: Plush Ocobius Aquatica
description: One of the worst brig medics that ever existed.
components:
- type: Sprite
state: plushie-okobius
@@ -740,8 +740,8 @@
- type: entity
parent: BasePlushie
id: PlushieVyacheslav
name: Плюшевый Вячеслав Некрасов
description: Популярная в соответствующих кругах личность.
name: Plushy Vyacheslav Nekrasov
description: A popular personality in relevant circles.
components:
- type: Sprite
state: plushie-vyacheslav
@@ -750,8 +750,8 @@
- type: entity
parent: [ EmitVulpGrowl, BasePlushie ]
id: PlushieLu
name: Плюшевый Лу'Сайм
description: Вы думаете, это вульпа-химик - женщина? Думайте так дальше... Иногда фыркает
name: Plush Lou'Slime
description: You think this vulpa chemist is a woman? Keep thinking that... Sometimes she snorts
components:
- type: Sprite
state: plushie-lu
@@ -760,8 +760,8 @@
- type: entity
parent: BasePlushie
id: PlushieAgata
name: Плюшеывый агент Агата Кацухиро
description: Эта плюшка была сделана на планетарной тюрьме, осуждёнными агентами Синдиката. Носи её с гордостью, корпорат
name: Plush Agent Agata Katsuhiro
description: This plushie was made on a planetary prison by convicted Syndicate agents. Wear it proudly, corporate
components:
- type: Sprite
state: plushie-agata
@@ -770,8 +770,8 @@
- type: entity
parent: BasePlushie
id: PlushieMilosTanka
name: Плюшевый Милос-Танака
description: Унати в форме Центрального Командования, что он может в себе скрывать кроме двух ножей и револьвера?
name: Plush Milos-Tanaka
description: Unathi in a Central Command uniform, what could he possibly be hiding in him besides two knives and a revolver?
components:
- type: Sprite
sprite: _Sunrise/Objects/Fun/toys.rsi
50 changes: 25 additions & 25 deletions Tools/_sunrise/Schemas/validate_yml.py
Original file line number Diff line number Diff line change
@@ -66,31 +66,31 @@ def check_translations(root_dir, ignore_list, ignore_files):
elif is_english(value):
add_error(rel_path, line_num, f'Не переведённая строка "{key}": {line.strip()}')

for dirpath, _, filenames in os.walk(en_locale_dir):
for filename in filenames:
if filename.endswith('.ftl'):
file_path = os.path.join(dirpath, filename)
rel_path = os.path.relpath(file_path, root_dir_abs)

if filename in ignore_files:
#print(f'Игнорирование файла: {filename}') Не нужно, если много файлов игнорирует
continue

with open(file_path, 'r', encoding='utf-8') as ftl_file:
lines = ftl_file.readlines()
for line_num, line in enumerate(lines, start=1):
if '=' in line and not line.strip().startswith('#'):
key, value = line.split('=', 1)
key = key.strip()
value = value.strip()
value = remove_braces_content(value)

if not is_english(value) and not contains_ignored_word(value, ignore_list):
if key.endswith('.desc') or key.endswith('.suffix'):
if has_russian(value):
add_error(rel_path, line_num, f'Русская строка "{key}": {line.strip()}')
elif has_russian(value):
add_error(rel_path, line_num, f'Русская строка "{key}": {line.strip()}')
#for dirpath, _, filenames in os.walk(en_locale_dir):
# for filename in filenames:
# if filename.endswith('.ftl'):
# file_path = os.path.join(dirpath, filename)
# rel_path = os.path.relpath(file_path, root_dir_abs)

# if filename in ignore_files:
# #print(f'Игнорирование файла: {filename}') Не нужно, если много файлов игнорирует
# continue

# with open(file_path, 'r', encoding='utf-8') as ftl_file:
# lines = ftl_file.readlines()
# for line_num, line in enumerate(lines, start=1):
# if '=' in line and not line.strip().startswith('#'):
# key, value = line.split('=', 1)
# key = key.strip()
# value = value.strip()
# value = remove_braces_content(value)

# if not is_english(value) and not contains_ignored_word(value, ignore_list):
# if key.endswith('.desc') or key.endswith('.suffix'):
# if has_russian(value):
# add_error(rel_path, line_num, f'Русская строка "{key}": {line.strip()}')
# elif has_russian(value):
# add_error(rel_path, line_num, f'Русская строка "{key}": {line.strip()}')

def check_yml_files(dir: str, ignore_list: List[str]):
key_pattern = re.compile(r'^(name|description|suffix|rules|desc):\s*(.+)')

0 comments on commit 196c5b3

Please sign in to comment.