Skip to content

Commit 24ceba4

Browse files
committed
Rebuild lang_switcher:class<LangSwitcher> is renamed from class<Lang>.
1 parent 83aea33 commit 24ceba4

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

doc/API reference.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ An enumeration representing two loading modes.
99

1010

1111

12-
## Lang
12+
## LangSwitcher
1313

1414
A working class for language conversion.
1515

1616
### Constructor
1717

1818
```python
19-
Lang(include, load_mode)
19+
LangSwitcher(include, load_mode)
2020
```
2121

2222
| Parameter | Type | Default | Description |
@@ -29,7 +29,7 @@ Lang(include, load_mode)
2929
### Default setting
3030

3131
```
32-
Lang().default_lang(source_lang, target_lang)
32+
LangSwitcher().default_lang(source_lang, target_lang)
3333
```
3434

3535
| Parameter | Type | Default | Description |
@@ -43,7 +43,7 @@ Lang().default_lang(source_lang, target_lang)
4343

4444
> The description of the universal word and the native word is in [doc](https://github.com/leoweyr/Python-OOPMultilang/blob/main/doc/data%20standard.md).
4545
46-
#### Lang().str(word, source_lang, target_lang)
46+
#### LangSwitcher().str(word, source_lang, target_lang)
4747

4848
String conversion method.
4949

@@ -53,20 +53,20 @@ String conversion method.
5353
| source_lang | string | "" | The source language to convert from. |
5454
| target_lang | string | "" | The target language to convert to. |
5555

56-
> `""` represents it is the default language set in `Lang().default_lang()`.
56+
> `""` represents it is the default language set in `LangSwitcher().default_lang()`.
5757
58-
#### Lang().universal
58+
#### LangSwitcher().universal
5959

6060
Object-oriented paradigm conversion method, only supports converting a universal word into other native word.
6161

6262
There are two syntax statements:
6363

6464
```python
6565
# Pure object-oriented paradigm suffix.
66-
Lang().universal.*
66+
LangSwitcher().universal.*
6767

6868
# End of suffix with the target language to convert to.
69-
Lang().universal.*.target_lang
69+
LangSwitcher().universal.*.target_lang
7070

7171
# `*` represents a specific universal word.
7272
```

examples/language_conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
2. ``"./lang/zh_cn.lang"``: Expression using the short-form kind. The file name "zh_cn" will be used as the name of the
1111
language associated with this language dictionary.
1212
"""
13-
ui_alt_lang = oopmultilang.Lang(
13+
ui_alt_lang = oopmultilang.LangSwitcher(
1414
include=(
1515
"./lang/en_us.lang as en_us",
1616
"./lang/zh_cn.lang"

oopmultilang/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from .lang import (
1+
from .lang_switcher import (
22
LoadMode,
3-
Lang,
3+
LangSwitcher,
44
LangDictSearchError
55
)
66

77

8-
__all__ = ["LoadMode", "Lang", "LangDictSearchError"]
8+
__all__ = ["LoadMode", "LangSwitcher", "LangDictSearchError"]

oopmultilang/lang.py renamed to oopmultilang/lang_switcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __repr__(self):
4747
return ChainedClass()
4848

4949

50-
class Lang:
50+
class LangSwitcher:
5151
def __init__(self, include=(), load_mode=LoadMode.REALTIME):
5252
self.__m_dict = {}
5353
self._m_load_mode = load_mode

0 commit comments

Comments
 (0)