Skip to content

Commit

Permalink
complete config for a tag
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax committed Jan 9, 2025
1 parent 5a8c4fc commit d395e20
Show file tree
Hide file tree
Showing 8 changed files with 18,848 additions and 273 deletions.
5 changes: 5 additions & 0 deletions build/attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ def add_reserve_value(self, value):
self.reserved_values.append(value)
return self

def add_reserve_values(self, values):
"""Add some reserved values for the attribute."""
self.reserved_values.extend(values)
return self

def validate(self):
"""Check if all languages have a value for the text."""
self.text.validate()
Expand Down
1 change: 1 addition & 0 deletions build/data/countries.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
{"name": "ICELAND", "code": "IS"},
{"name": "INDIA", "code": "IN"},
{"name": "INDONESIA", "code": "ID"},
{"name": "IRAN", "code": "IR"},
{"name": "IRAN, ISLAMIC REPUBLIC OF", "code": "IR"},
{"name": "IRAQ", "code": "IQ"},
{"name": "IRELAND", "code": "IE"},
Expand Down
399 changes: 201 additions & 198 deletions build/data/languages.py

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions build/lang.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ class Lang:
languages = {}

@classmethod
def add_lang(cls, name, full_name, international_name):
def add_lang(self, name, full_name, international_name):
"""Add a new language to the list of supported languages."""
cls.languages[name] = {
self.languages[name] = {
"code": name,
"full_name": full_name,
"international_name": international_name,
}
setattr(cls, name, name)
setattr(self, name, name)

@classmethod
def get_languages(cls):
def get_languages(self):
"""Get the list of supported languages."""
return cls.languages
return self.languages

def __getattr__(self, name):
"""Get the object for a specific language."""
Expand Down
Loading

0 comments on commit d395e20

Please sign in to comment.