Skip to main content

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

python-readme-generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mac-localized-2019.4.13.tar.gz (2.6 kB view hashes)

Uploaded Source

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