macos“.localized”本地化文件夹名

项目详细描述

安装
$ [sudo] pip install mac-localized

工作原理
Release Notes.localized/
    .localized/
        en.strings
        de.strings
        ja.strings

.strings

"Release Notes" = "Localized name";

函数

function ^{}
^{} return path with ^{} postfix
^{} return translation
^{} return dictionary with keys as languages and translations with values
^{} mkdir (if not exists), write translations and return folder fullpath
^{} return folder name without ^{} prefix
^{} rm .localized/ lang files or .localized/ folder
^{} update folder translations
^{} return a list with ^{} files
^{} return dictionary with keys as languages and translations with values

示例

>>> import mac_localized
>>> mac_localized.mkdir("folder",ru="ru translation",de="de translation")
'folder.localized'

>>> mac_localized.load("folder")
{'ru':'ru translation','de':'de translation'}

>>> mac_localized.update("folder",ru="new ru translation",de="new de translation")

>>> mac_localized.get("folder","ru")
'new ru translation'

>>> mac_localized.rm("folder",["ru"])
>>> mac_localized.rm("folder")  # rm all localizations

链接

python-readme-generator

最新Python第三方库