{"id":17052186,"url":"https://github.com/pronebird/pomo-iphone","last_synced_at":"2025-08-18T10:06:01.273Z","repository":{"id":2981384,"uuid":"3997230","full_name":"pronebird/pomo-iphone","owner":"pronebird","description":"Gettext translations for iOS","archived":false,"fork":false,"pushed_at":"2017-06-14T12:16:38.000Z","size":457,"stargazers_count":13,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-06T21:44:00.653Z","etag":null,"topics":["gettext","ios"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pronebird.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-11T19:19:08.000Z","updated_at":"2023-02-09T06:30:36.000Z","dependencies_parsed_at":"2022-09-22T00:32:26.628Z","dependency_job_id":null,"html_url":"https://github.com/pronebird/pomo-iphone","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/pronebird/pomo-iphone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronebird%2Fpomo-iphone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronebird%2Fpomo-iphone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronebird%2Fpomo-iphone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronebird%2Fpomo-iphone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pronebird","download_url":"https://codeload.github.com/pronebird/pomo-iphone/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronebird%2Fpomo-iphone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270975507,"owners_count":24678327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gettext","ios"],"created_at":"2024-10-14T10:08:48.645Z","updated_at":"2025-08-18T10:06:01.236Z","avatar_url":"https://github.com/pronebird.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# POMO-iphone\n\nPOMO-iphone is a gettext translations for iPhone written in Objective-C. It supposed to be a good substitution for outdated Apple translations system. However I still use default mechanisms to translate settings.bundle and Storyboard, so this solution is not 100% perfect.\n\n## Basic usage\n\n```objective-c\n\n// Import POMO-iPhone with Gettext helper methods\n#import \"GettextHelpers.h\"\n\n// Load default textdomain, TEXTDOMAIN constant defined in GettextHelpers.h\n// Make sure you created a default-xx.po file in your app resources\n// Call somewhere in -(BOOL)application:willFinishLaunchingWithOptions:\n[[TranslationCenter sharedCenter] loadTextDomain:DEFAULT_TEXTDOMAIN];\n\nNSInteger numApples = 10;\n\n// Translate single string\nNSLog(@\"Gettext translated string: %@\", _(@\"Hi, this is gettext!\"));\n\n// Translate plural string\nNSLog(@\"Gettext translated plural: %@\", _n(@\"%d apple\", @\"%d apples\", numApples));\n\n// Translate and format altogether\nNSLog(@\"Gettext translated plural: %@\", [NSString stringWithFormat:_n(@\"%d apple\", @\"%d apples\", numApples), numApples]);\n\n```\n\nFor more information, see:\n\n* [GettextHelpers.h](https://github.com/pronebird/pomo-iphone/blob/master/pomo-iphone/GettextHelpers.h)\n* [TranslationCenter.h](https://github.com/pronebird/pomo-iphone/blob/master/pomo-iphone/TranslationCenter.h)\n\n## TranslationCenter\n\nTranslationCenter is a manager for textdomains and strings' translations, it has few options that you can override. To obtain a shared center use the following code:\n\n```objective-c\n\nTranslationCenter* translator = [TranslationCenter sharedCenter];\n```\n\n- `translator.defaultPath` - by default it's path to your app bundle\n- `translator.language` - by default it's current UI language\n\nYou can use TranslationCenter directly to translate strings, however it's not really handy, so I suggest using GettextHelpers which provide shorthandle functions for the frequently used functions.\n\n## Single textdomain shorthandles\n\nSingle textdomain shorthandles use default textdomain and help you to keep your code shorter if you don't need more than one textdomain in your app.\n\n`_(singular)` - single string translation\n\n`_n(singular, plural, number)` - plural translation\n\n`_x(singular, context)` - single string translation with context\n\n`_nx(singular, plural, number, context)` - plural translation with context\n\n## Other shorthandles with custom textdomain\n\nUsing following functions you must explicitly specify textdomain, useful if you have many textdomains in your app:\n\n`_(singular, textdomain)` - single string translation\n\n`_n(singular, plural, number, textdomain)` - plural translation\n\n`_x(singular, context, textdomain)` - single string translation with context\n\n`_nx(singular, plural, number, context, textdomain)` - plural translation with context\n\n## Textdomain lookup algorithm\n\nTranslationCenter looks for `.mo` or `.po` files with the following pattern:\n\n`%app-bundle-path/%textdomain-%language.%extension`\n\nwhere `%language` is a language two letter code (e.g. ru, en, es, etc..)\n`%extension` is usually `mo` or `po`. `mo` files have higher priority since it's more compact format and supposed to be used for distribution.\n`%textdomain` - default or your own textdomain that you specify in your source code.\n\nExample path may look like that:\n\n`/MyApp.app/default-es.mo`\n\n## Build notes\n\n### Manual\n\n- Link your app against `libstdc++.dylib`\n\n- Pomo-iphone depends on `muparser-iphone`. So at the end you'll have a workspace with `muparser-iphone` and `pomo-iphone` compiled in the same order as mentioned.\n\n- Link your app against `libpomo-iphone`\n\n### Automatic via CocoaPod\n\nAdd the following line in your Podfile:\n\n`pod 'pomo-iphone', :git =\u003e 'git://github.com/pronebird/pomo-iphone.git', :submodules =\u003e true`\n\n## Poedit Settings\n\nIf you use Poedit, follow the instructions below to setup Objective-C parser.\n\nGo to Poedit \u003e Preferences and add new parser with the following settings:\n\n- List of extensions:\n`*.m;*.mm;*.c;*.h;`\n\n- Parser command:\n`xgettext --force-po -o %o %C %K %F -L ObjectiveC`\n\n- An item in keywords list:\n`-k%k`\n\n- An item in input files:\n`%f`\n\n- Source code charset:\n`--from-code=%c`\n\nAlso you can use `--add-comments=/` flag in Parser commands to enable translators' comments. In this example all comments starting with triple slash will be treated as translators' comments.\n\n## Poedit Catalog Settings\n\nSetup the following keywords for your catalog to make Poedit work with your source code:\n\n    _\n    _x:2c,1\n    _nx:4c,1,2\n    _n:1,2\n    _n_noop:1,2\n    _nx_noop:3c,1,2\n\n\n## License (MIT)\n\n### POMO-iphone\n\nCopyright (c) 2012-2014 Andrej Mihajlov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n## 3rd-party components\n\n### muParser\n\nCopyright (C) 2004-2011 Ingo Berg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this \nsoftware and associated documentation files (the \"Software\"), to deal in the Software\nwithout restriction, including without limitation the rights to use, copy, modify, \nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to \npermit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or \nsubstantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT\nNOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpronebird%2Fpomo-iphone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpronebird%2Fpomo-iphone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpronebird%2Fpomo-iphone/lists"}