No project description provided
Project description
langful
install
Use pip
to install pip install langful
or pip3 install langful
example
- test.py
- lang
- zh_cn.json
- en_us.json
zh_cn.json
{
"hi" : "你好" ,
"welcome" : "欢迎"
}
en_us.json
{
"hi" : "Hi" ,
"welcome" : "Welcome"
}
tset.py
import langful
Text = langful.lang()
print( Text.language_dict )
print( Text.replace( "%hi%" , lang_str = "zh_cn" ) )
print( Text.replace( "!hi!" , lang_str = "zh_cn" , change = "!" ) )
print( Text.replace( "%welcome%" , lang_str = "zh_cn" ) )
print( Text.replace( "!welcome!" , lang_str = "zh_cn" , change = "!" ) )
print( Text.replace( "%hi%" , lang_str = "en_us" ) )
print( Text.replace( "!hi!" , lang_str = "en_us" , change = "!" ) )
print( Text.replace( "%welcome%" , lang_str = "en_us" ) )
print( Text.replace( "!welcome!" , lang_str = "en_us" , change = "!" ) )
print( )
print( Text.replace( "%%" ) )
print( Text.replace( "!!" , change = "!" ) )
Output
{'en_us': {'welcome': 'Welcome', 'hi': 'Hi'}, 'zh_cn': {'welcome': '欢迎', 'hi': '你好'}}
你好
你好
欢迎
欢迎
Hi
Hi
Welcome
Welcome
%
!
About
github: https://github.com/cueavyqwp/langful
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for langful-0.21-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc66a3d600e09ea76557457168c5bef3c43d0bdcef52ad0414fbdb57ddeedaa2 |
|
MD5 | 8c41299351b26259eda43083e4e93adb |
|
BLAKE2b-256 | 0c00944bb36fcdb0f94dff8c1f24d619e0cd33034f8c91d1203cf75328b67e2b |