{ "info": { "author": "Jacco Taal", "author_email": "jacco@bitnomica.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Topic :: Utilities" ], "description": "localize\\_m: Easy localization of objc ``.m`` files\r\n===================================================\r\n\r\nLocalize\\_m helps with localizing your objc ``.m`` files. It has two\r\nmodes:\r\n\r\n1. Interactively parse your file, and ask for each string whether it\r\n should be localized ( ``--ask-all`` option).\r\n2. Automatically parse your file and replace each ``@\"...\"`` string\r\n prefixed with ``__LOCALIZE`` with a localized version. This mode can\r\n run in a fully automated fashion or, when you use the ``-c`` option,\r\n ``localize_m`` will ask you to edit the slug and to provide a comment\r\n for the translator.\r\n\r\nlocalize\\_m inserts the following code for each ``@\"...\"`` string you\r\nchoose to replace:\r\n\r\n::\r\n\r\n NSLocalizedStringWithDefaultValue(, kDefaultLocalizationTable, kClassBundle, @\"...\", @\"...\")\r\n\r\nWe use this function instead of NSLocalizedString, as it gives full\r\nflexibilty, and provides comments to the translator. In fact, we do not\r\nrecommend using NSLocalizedString.\r\n\r\nSlugs and Localization ID's\r\n---------------------------\r\n\r\nLocalize\\_m automatically generates slugs from your strings to act as\r\nidentifiers for your translations. Formatting codes ``%@``, ``%d``, etc\r\nare replaced by ``[]`` in your slugs, for ease of reading. Why do we use\r\nslugs as id?\r\n\r\n1. slugs should uniquely describe the string. Even if you have the same\r\n @\"Example\" string at multiple place in your code, you may want to be\r\n able to translate to Dutch with @\"Voorbeeld\", and with @\"Bijv.\" at\r\n another place. So if you use slugs ``example-long-form`` and\r\n ``example-short-form``, you can discriminiate between the two\r\n2. To help you resist the temptation to edit the ID. Never edit the ID,\r\n when your strings have been translated.\r\n\r\nTip:\r\n----\r\n\r\nIn your project.pch precompiled header define:\r\n\r\n.. code:: c\r\n\r\n #define __LOCALIZE\r\n #define kClassBundle [NSBundle bundleForClass:[self class]]\r\n #define kDefaultLocalizationsTable nil\r\n\r\nThis makes sure that your project compiles, even when you have put\r\n``__LOCALIZE``\\ s in your code, and haven't run the localize\\_m script\r\nyet. We use ``[NSBundle bundleForClass:[self class]]`` so that your\r\nproject is framework compatible. You can manually override the\r\nkDefaultLocalizationsTable with a string, when you want to use another\r\ntable than the default Localizations.strings file.\r\n\r\nUsage\r\n=====\r\n\r\n::\r\n\r\n localize_m [-h] [-p PATH] [-o [outfile]] [-a] [-c] [--inplace]\r\n [--table TABLE] [--bundle BUNDLE] [--replace REPLACE]\r\n [infile]\r\n\r\n Input:\r\n -p PATH, --path PATH localize all .m files in path\r\n infile Input .m file\r\n -o [outfile], --outfile [outfile]\r\n Output file, otherwise stdout\r\n -a, --ask-all ask for all strings (interactive))\r\n -c, --comments ask for comments and ids (interactive)\r\n --inplace localize file in-place\r\n\r\n Customization:\r\n --table TABLE custom localizations table argument\r\n --bundle BUNDLE custom NSBundle argument\r\n --replace REPLACE Auto localization prefix string\r\n \r\n\r\nInstallation\r\n------------\r\n\r\nLocalize\\_m uses python, which is installed on every Mac by default. Use\r\npip to install:\r\n\r\n::\r\n\r\n # pip install localize_m\r\n Collecting localize-m\r\n Downloading Localize_M-1.0.tar.gz\r\n Collecting colored (from localize-m)\r\n Using cached colored-1.2.1.tar.gz\r\n Collecting slugify (from localize-m)\r\n Using cached slugify-0.0.1.tar.gz\r\n Collecting gnureadline (from localize-m)\r\n Using cached gnureadline-6.3.3-cp27-none-macosx_10_6_intel.whl\r\n Installing collected packages: colored, slugify, gnureadline, localize-m\r\n Running setup.py install for colored\r\n Running setup.py install for slugify\r\n Running setup.py install for localize-m\r\n Successfully installed colored-1.2.1 gnureadline-6.3.3 localize-m-1.0 slugify-0.0.1\r\n\r\n #\r\n\r\nExamples\r\n========\r\n\r\nOne file\r\n--------\r\n\r\n::\r\n\r\n # cd project/src\r\n # localize_m MainViewController.m --comments --inplace\r\n\r\nAll m files\r\n-----------\r\n\r\n::\r\n\r\n localize_m -p ./ --comments\r\n\r\nYou can go through all files. Press CTRL-C to save your changes and\r\nquit. Just start localize\\_m again to resume where you left.\r\n\r\nCustomize\r\n---------\r\n\r\n::\r\n\r\n # localize_m MainViewController.m --table '@\"MyTable\"' --bundle '[NSBundle mainBundle]'\r\n\r\nUses the ``@\"MyTable\"`` string as the localizationsTable argument and\r\n``[NSBundle mainBundle]`` as the bundle argument for\r\nNSLocalizedStringWithDefualtFormat funtion.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jrtaal/localize_m", "keywords": "", "license": "LICENSE.txt", "maintainer": "", "maintainer_email": "", "name": "Localize_M", "package_url": "https://pypi.org/project/Localize_M/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Localize_M/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jrtaal/localize_m" }, "release_url": "https://pypi.org/project/Localize_M/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "Localize objc M files", "version": "1.0.1" }, "last_serial": 1756569, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "6b50f5bc7b325e83a15da6199c74ca81", "sha256": "7493c79d493612f16f0ae326d9a233d6143576ad65fa5fef99047d5cf27ae720" }, "downloads": -1, "filename": "Localize_M-1.0.1.tar.gz", "has_sig": false, "md5_digest": "6b50f5bc7b325e83a15da6199c74ca81", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5519, "upload_time": "2015-10-07T13:25:08", "url": "https://files.pythonhosted.org/packages/03/0b/f80806b9b4dff5cc76ff54f2f15cff04c631437d8bd7f56a3fc1273ace30/Localize_M-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6b50f5bc7b325e83a15da6199c74ca81", "sha256": "7493c79d493612f16f0ae326d9a233d6143576ad65fa5fef99047d5cf27ae720" }, "downloads": -1, "filename": "Localize_M-1.0.1.tar.gz", "has_sig": false, "md5_digest": "6b50f5bc7b325e83a15da6199c74ca81", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5519, "upload_time": "2015-10-07T13:25:08", "url": "https://files.pythonhosted.org/packages/03/0b/f80806b9b4dff5cc76ff54f2f15cff04c631437d8bd7f56a3fc1273ace30/Localize_M-1.0.1.tar.gz" } ] }