macOS '.localized' localized folder name
Project description
Installation
$ [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 | __doc__ |
---|---|
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 a 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
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-2019.3.22-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3542a8e9476d05b7158eab76ac3b01cd01ae82f59ae1503023eb62a0e788b6d |
|
MD5 | 1537b8318d42e628af3b63af5860c5d6 |
|
BLAKE2b-256 | b7942dd3d4793af89045a9e222655bdc2380ff87c96dffe013a65110a8312d62 |