'.localized' MacOS localized folder name
Project description
Install
$ [sudo] pip install mac-localized
How it works
Release Notes.localized/
.localized/
en.strings
de.strings
ja.strings
.strings
:
"Release Notes" = "Localized name";
Functions
function | description |
---|---|
mac_localized.fullpath(path) |
return path with .localized postfix |
mac_localized.get(path, lang) |
return translation |
mac_localized.load(path) |
return dictionary with keys as languages and translations with values |
mac_localized.mkdir(path, **strings) |
mkdir (if not exists), write translations and return folder fullpath |
mac_localized.name(path) |
return folder name without .localized prefix |
mac_localized.rm(path, languages=None) |
rm .localized/ lang files or .localized/ folder |
mac_localized.update(path, **strings) |
update folder translations |
mac_localized.strings.find(path) |
return list with .strings files |
mac_localized.strings.load(path) |
return dictionary with keys as languages and translations with values |
Examples
>>> 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
Links
readme-md - README.md generator
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 Distribution
Built Distribution
Close
Hashes for mac_localized-2018.11.20-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23bfb7ae30b8fee3a7b3c9034e082ff452c78802278a66f4cdf43b2cd33e3895 |
|
MD5 | d4217c9b65d84626c3642acb4326a839 |
|
BLAKE2b-256 | 2d3a8f372f80f76630ab6bf6fc72784c926397a59440bfc5ef6272fd275a4f58 |