Skip to content

Commit

Permalink
Add croatian language (NamelessMC#2990)
Browse files Browse the repository at this point in the history
  • Loading branch information
Derkades authored Aug 7, 2022
1 parent 98fe4b7 commit eee47b3
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/classes/Core/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ class Language {
'name' => 'Vietnamese',
'htmlCode' => 'vi',
],
'hr_HR' => [
'name' => 'Croatian',
'htmlCode' =>'hr',
],
];

/**
Expand Down
1 change: 1 addition & 0 deletions custom/languages/hr_HR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions modules/Cookie Consent/language/hr_HR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions modules/Discord Integration/language/hr_HR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions modules/Forum/language/hr_HR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
19 changes: 19 additions & 0 deletions scripts/create_lang.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import sys
from pathlib import Path

if __name__ == '__main__':
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <language code>_<country code>")
sys.exit(1)

name = sys.argv[1]

modules = [e.name for e in Path('modules').iterdir() if e.name != 'Core']
paths = [Path('modules', module, 'language', name + '.json') for module in modules]
paths.append(Path('custom', 'languages', name + '.json'))

for path in paths:
with path.open('bw+') as f:
f.write(b'{}\n')

print("Done. Don't forget to add the language to core/classes/Language/Language.php")

0 comments on commit eee47b3

Please sign in to comment.