{"id":17129028,"url":"https://github.com/michaelhenry/localizr","last_synced_at":"2025-04-13T06:32:14.161Z","repository":{"id":26932697,"uuid":"102756292","full_name":"michaelhenry/Localizr","owner":"michaelhenry","description":"Localizr is a Tool that handles and automates the generation of localization files for IOS and Android so there will be only one source of truth for all of your localization strings.","archived":false,"fork":false,"pushed_at":"2023-02-15T19:07:11.000Z","size":755,"stargazers_count":36,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T23:11:42.395Z","etag":null,"topics":["actions","android","android-application","dsl","fastlane","i18n","ios","locale","localization","mobile","translation"],"latest_commit_sha":null,"homepage":"http://localizr.iamkel.net","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelhenry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["michaelhenry"]}},"created_at":"2017-09-07T15:47:14.000Z","updated_at":"2025-03-26T05:20:12.000Z","dependencies_parsed_at":"2023-01-14T05:38:30.991Z","dependency_job_id":null,"html_url":"https://github.com/michaelhenry/Localizr","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelhenry%2FLocalizr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelhenry%2FLocalizr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelhenry%2FLocalizr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelhenry%2FLocalizr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelhenry","download_url":"https://codeload.github.com/michaelhenry/Localizr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248674674,"owners_count":21143760,"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","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":["actions","android","android-application","dsl","fastlane","i18n","ios","locale","localization","mobile","translation"],"created_at":"2024-10-14T19:08:40.741Z","updated_at":"2025-04-13T06:32:13.343Z","avatar_url":"https://github.com/michaelhenry.png","language":"Python","funding_links":["https://github.com/sponsors/michaelhenry"],"categories":[],"sub_categories":[],"readme":"# Localizr\n\n[![Build Status](https://travis-ci.org/michaelhenry/Localizr.svg?branch=master)](https://travis-ci.org/michaelhenry/Localizr)\n[![Twitter](https://img.shields.io/badge/twitter-@michaelhenry119-blue.svg?style=flat)](https://twitter.com/michaelhenry119)\n[![Docker](https://img.shields.io/badge/docker-michaelhenry119/localizr-red.svg?style=flat)](https://hub.docker.com/r/michaelhenry119/localizr/tags/)\n[![Version](https://img.shields.io/badge/version-1.3-yellow.svg?style=flat)](#)\n\n\nLocalizr is a Tool that handles and automates localization files. Basically we give limited access to the translators to let them input or upload different keystrings and the developer will just fetch it on development or deployment only when if there is an update or changes. This will lessen or prevent the mistake that developer made because he/she has no clue what are those words are and most of them (including me, but not all) are just copy pasting those words (especially when it comes to chinese or japanese characters) from excel to the Localizable.strings via Xcode.\n      \n\n## Features\n- Multi-App support. reusable keys for different applications.\n- Android and IOS support.\n- Integrated with `Fastlane actions`. (`Fastlane actions localizr`) \n- Default fallback for missing localizations.\n- Export and import to different file format.\n- Easy deployment: [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/michaelhenry/localizr)\n- Dockerized: `docker pull michaelhenry119/localizr`\n- Static files hosted in AWS S3 (Optional)\n- Snapshots\n\n\n## DEMO\n- http://localizr.iamkel.net\nYou can access the demo pages with this credential:\n```\nusername: demo\npassword: localizr\n```\n\n\n## IOS Client\nI have created a demo IOS App, You can pull it from [Localizr.swift](https://github.com/michaelhenry/Localizr.swift).\n\n\n## For Developers\n### Strings Generator\n```\nhttp://{your_server.com}/app/{app_slug}.{locale_code}\n```\n- http://localizr.iamkel.net/app/demo.en\n- http://localizr.iamkel.net/app/demo.ja\n\n### Format\n#### iOS\n- http://localizr.iamkel.net/app/demo.ja?format=ios\n\n### Android\n- http://localizr.iamkel.net/app/demo.ja?format=android\n\n### Integrate to your Android or IOS Project?\nBy using `Fastlane`. Currently `localizr` action is not officially available in `fastlane` repo, so you have to manually grab it from here  [fastlane/actions](/fastlane/actions) and paste the `actions` folder directly to your project 's `fastlane` folder in order to make this available to your local.\nhere is the shortcut:\n```bash\n# from your workplace root folder:\n$ curl -o fastlane/actions/localizr.rb https://raw.githubusercontent.com/michaelhenry/Localizr/master/fastlane/actions/localizr.rb\n```\n\n```bash\n$ fastlane actions localizr\n```\n![fastlane actions localizr](docs/images/fastlane_actions_localizr.png)\n\n#### Sample configuration on IOS\n```ruby\ndesc \"Submit build to TestFlight.\"\nlane :beta do\n  increment_build_number\n  # ...\n  localizr(\n    localizr_server: 'http://your_localizr_server',\n    localizr_api_token: 'your-auth-token-from-admin-page',\n    locale_codes:  'en,ja,pt,zh,es',\n    localizr_app_slug: 'your-app-slug',\n    output_target_path: 'ExampleApp',\n    platform: 'ios',\n  )\n  gym\n  # ...\nend\n```\n\n#### Sample configuration on Android\n```ruby\nlane :beta do\n  localizr(\n    localizr_server: 'http://your_localizr_server',\n    localizr_api_token: 'your-auth-token-from-admin-page',\n    locale_codes:  'en,ja,pt,zh,es',\n    localizr_app_slug: 'your-app-slug',\n    output_target_path: 'res'\n  ),\n  gradle(\n    task: 'assemble',\n    build_type: 'Release'\n  )\n  # ...\nend\n```\n\n### You can also use environment variables if you dont want to configure it from Fastfile:\n\n```bash\nexport FL_LOCALIZR_SERVER='http://your_localizr_server'\nexport FL_LOCALIZR_API_TOKEN='your-auth-token-from-admin-page'\nexport FL_LOCALIZR_APP_SLUG='your-app-slug'\nexport FL_LOCALIZR_BASE_LOCALE_CODE='en'\nexport FL_LOCALIZR_LOCALE_CODES='en,es,ja,zh,pt'\nexport FL_LOCALIZR_PLATFORM='ios'\nexport FL_LOCALIZR_OUTPUT_TARGET_PATH='ExampleApp'\n```\n\nExample:\n\n```ruby\ndesc \"Submit build to TestFlight.\"\nlane :beta do\n  increment_build_number\n  # ...\n  localizr\n  gym\n  # ...\nend\n```\n\n### S3 Configuration\nThis is optional, but you can enable this by providing valid information for the following in the environment variables.\n```bash\nexport AWS_ACCESS_KEY_ID='Your aws access key id'\nexport AWS_SECRET_ACCESS_KEY='Your secret key'\nexport AWS_STORAGE_BUCKET_NAME='Name of the bucket'\n```\n\n## For Non-Developers, Translators or even Developers.\n### How to use Localizr?\n\n1. Create different `Locales` set the `name` and the `code`.\n2. Create an `App` and set the `base_locale` if you want to have a fallback for missing `localized strings`.\n3. Create Different `Keys`.\n4. Match the `Keys` with the `App` so you can re-use the keys to other apps too.\n5. Finally, populate the `localized strings` .\n\n\n#### Does it look difficult? \n### Then try to use the importer (csv, xls, xlsx, tsv, json, yaml).\nYou can find the sample csv files in the [sample_data](/sample_data) folder.\n\n1. Import the `Locales.csv` to `Locales` section.\n2. Import the `Apps.csv` to `Apps` section.\n3. Import the `App's Keys.csv` to `App 's Keys` section.\n4. Import the `Localized String.csv` to `Localized String` section.\n\n![import admin import](docs/images/admin_localized_strings_import.png)\n\n![import button](docs/images/admin_import.png)\n\n![import change diff](docs/images/admin_import_compare.png)\n\n\n### How about exporting?\nJust find the `EXPORT` button, select the `format` and that's it.\n\n## Deployment\n### Using Heroku\nJust click this button \u003e++\u003e [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/michaelhenry/localizr)\n\nIf you're using heroku's free dyno and the waking time is longer than expected, you disable the auto migration option by setting the environment variable:\n\n```\nLOCALIZR_DISABLE_AUTO_MIGRATION=1\n```\n\n### Using Docker\nsample config of `docker-compose.yml`\n```yml\nversion: '3'\n\nservices:\n  db:\n    image: postgres:9.4\n    volumes:\n      - pg-data:/var/lib/postgresql/data\n    ports:\n      - \"5432:5432\"  \n    environment:\n      - POSTGRES_PASSWORD=your_db_password\n\n  localizr:\n    image: michaelhenry119/localizr:latest\n    container_name: localizr\n    ports:\n      - \"80:8001\"\n    environment:\n      # Reference: postgres://USER:PASSWORD@HOST:PORT/NAME, this example is using the default postgres database.\n      - DATABASE_URL=postgres://postgres:your_db_password@db:5432/postgres\n      # You have to define your host name here to prevent any random attacks.\n      - ALLOWED_HOSTS=0.0.0.0,localizr.domain.com,or_any_domain\n      # This is optional, you can assign a default then change it later from the admin page. \n      # Or you can do it programatically after you mount the image.\n      - ADMIN_USERNAME=admin\n      - ADMIN_PASSWORD=change_me_later\n      - ADMIN_EMAIL=your_email@email.com\n    depends_on:\n      - db\nvolumes:\n  pg-data:\n```\n\n### Local setup (via virtualenv)\n\nInstall virtualenv\n```bash\n$ pip install virtualenv\n```\n\nCreate a virtual environment `venv`\n```bash\n$ virtualenv venv\n```\n\nActivate the virtual environment\n```bash\n$ source venv/bin/activate\n```\n\nInstall the dependencies\n```bash\n$ pip install -r requirements_local.txt\n```\n\nMigrate to create a local sqlite database\n```bash\n$ python manage.py migrate --settings=project.settings\n```\n\nCreate a super user (login account)\n```bash\n$ python manage.py createsuperuser --settings=project.settings\n```\n\nRun the local server\n```bash\n$ python manage.py runserver --settings=project.settings\n```\n\nopen [http://127.0.0.1:8000/](http://127.0.0.1:8000/) from your browser and use the login credentials you provided.\n\n## Snapshot\nSnapshot is supported by passing a query param `?snapshot=your_any_key_or_build_number` to the localizedkeystrings request.\n\n\n## Recommendation and Automation:\nWith using `CI` and `Fastlane`, create a script or use `fastlane actions localizr` to download and update all the localization strings before `gym` method, So we can always make sure that all strings are updated. \n\n\n## TODO:\n\n- [x] iOS format support\n- [x] Android format support\n- [x] Import/Export contents via CSV file\n- [x] CI\n- [x] Test cases\n- [x] Docker container support.\n- [x] Snapshot support.\n- [ ] Interactive UI.\n- [ ] Able to use google translate for some missing translations.\n\n\n## Author\n\nMichael Henry Pantaleon, me@iamkel.net\n\n## License\n\nLocalizr is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelhenry%2Flocalizr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelhenry%2Flocalizr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelhenry%2Flocalizr/lists"}