Skip to main content

No project description provided

Project description

langful

PyPI version Python version license Github stars Github issues

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

pypi: https://pypi.org/project/langful

issues: https://github.com/cueavyqwp/langful/issues

Project details


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

langful-0.19-py2.py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page