All Projects → michaelhenry → Localizr

michaelhenry / Localizr

Licence: MIT license
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.

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Localizr

awesome-translations
😎 Awesome lists about Internationalization & localization stuff. l10n, g11n, m17n, i18n. Translations! 🌎🌍
Stars: ✭ 54 (+63.64%)
Mutual labels:  localization, locale
Localizr.swift
Simplified and automated Localization process library in IOS. Please check https://github.com/michaelhenry/Localizr for more info.
Stars: ✭ 18 (-45.45%)
Mutual labels:  localization, locale
HitNotes
Rhythm-based mobile game
Stars: ✭ 24 (-27.27%)
Mutual labels:  fastlane, actions
local.js
Localization script for web sites which has the multiple languages.
Stars: ✭ 15 (-54.55%)
Mutual labels:  localization, locale
laravel-localizer
Automatically detect and set an app locale that matches your visitor's preference.
Stars: ✭ 34 (+3.03%)
Mutual labels:  localization, locale
cldr-engine
Internationalization and localization in Typescript with Unicode CLDR, batteries included
Stars: ✭ 34 (+3.03%)
Mutual labels:  localization, locale
locale-switcher
Browser Extension to quickly change your browser locale.
Stars: ✭ 75 (+127.27%)
Mutual labels:  localization, locale
laravel-localized-routes
A convenient way to set up and use localized routes in a Laravel app.
Stars: ✭ 257 (+678.79%)
Mutual labels:  localization, locale
go-locale
GoLang library used to retrieve the current locale(s) of the operating system.
Stars: ✭ 16 (-51.52%)
Mutual labels:  localization, locale
rosetta
A blazing fast internationalization (i18n) library for Crystal with compile-time key lookup.
Stars: ✭ 23 (-30.3%)
Mutual labels:  localization, locale
Counterpart
A translation and localization library for Node.js and the browser.
Stars: ✭ 239 (+624.24%)
Mutual labels:  localization
Laravel Multilingual Routes
A package to handle multilingual routes in your Laravel application.
Stars: ✭ 241 (+630.3%)
Mutual labels:  localization
opensource
Collection of Open Source packages by Otherwise
Stars: ✭ 21 (-36.36%)
Mutual labels:  localization
flutter localizations
Flutter Localization
Stars: ✭ 21 (-36.36%)
Mutual labels:  localization
Tonav
Implementation of Multi-State Constraint Kalman Filter (MSCKF) for Vision-aided Inertial Navigation. This is my master's thesis.
Stars: ✭ 235 (+612.12%)
Mutual labels:  localization
action-my-broken-link-checker
A GitHub Action for checking broken links
Stars: ✭ 32 (-3.03%)
Mutual labels:  actions
Iscloam
Intensity Scan Context based full SLAM implementation for autonomous driving. ICRA 2020
Stars: ✭ 232 (+603.03%)
Mutual labels:  localization
L10ns
Internationalization workflow and formatting
Stars: ✭ 234 (+609.09%)
Mutual labels:  localization
Lang.js
🎭 Laravel Translator class in JavaScript!
Stars: ✭ 232 (+603.03%)
Mutual labels:  localization
gh-token
Create an installation access token for a GitHub app from your terminal 💻
Stars: ✭ 154 (+366.67%)
Mutual labels:  actions

Localizr

Build Status Twitter Docker Version

Localizr 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.

Features

  • Multi-App support. reusable keys for different applications.
  • Android and IOS support.
  • Integrated with Fastlane actions. (Fastlane actions localizr)
  • Default fallback for missing localizations.
  • Export and import to different file format.
  • Easy deployment: Deploy
  • Dockerized: docker pull michaelhenry119/localizr
  • Static files hosted in AWS S3 (Optional)
  • Snapshots

DEMO

username: demo
password: localizr

IOS Client

I have created a demo IOS App, You can pull it from Localizr.swift.

For Developers

Strings Generator

http://{your_server.com}/app/{app_slug}.{locale_code}

Format

iOS

Android

Integrate to your Android or IOS Project?

By using Fastlane. Currently localizr action is not officially available in fastlane repo, so you have to manually grab it from here fastlane/actions and paste the actions folder directly to your project 's fastlane folder in order to make this available to your local. here is the shortcut:

# from your workplace root folder:
$ curl -o fastlane/actions/localizr.rb https://raw.githubusercontent.com/michaelhenry/Localizr/master/fastlane/actions/localizr.rb
$ fastlane actions localizr

fastlane actions localizr

Sample configuration on IOS

desc "Submit build to TestFlight."
lane :beta do
  increment_build_number
  # ...
  localizr(
    localizr_server: 'http://your_localizr_server',
    localizr_api_token: 'your-auth-token-from-admin-page',
    locale_codes:  'en,ja,pt,zh,es',
    localizr_app_slug: 'your-app-slug',
    output_target_path: 'ExampleApp',
    platform: 'ios',
  )
  gym
  # ...
end

Sample configuration on Android

lane :beta do
  localizr(
    localizr_server: 'http://your_localizr_server',
    localizr_api_token: 'your-auth-token-from-admin-page',
    locale_codes:  'en,ja,pt,zh,es',
    localizr_app_slug: 'your-app-slug',
    output_target_path: 'res'
  ),
  gradle(
    task: 'assemble',
    build_type: 'Release'
  )
  # ...
end

You can also use environment variables if you dont want to configure it from Fastfile:

export FL_LOCALIZR_SERVER='http://your_localizr_server'
export FL_LOCALIZR_API_TOKEN='your-auth-token-from-admin-page'
export FL_LOCALIZR_APP_SLUG='your-app-slug'
export FL_LOCALIZR_BASE_LOCALE_CODE='en'
export FL_LOCALIZR_LOCALE_CODES='en,es,ja,zh,pt'
export FL_LOCALIZR_PLATFORM='ios'
export FL_LOCALIZR_OUTPUT_TARGET_PATH='ExampleApp'

Example:

desc "Submit build to TestFlight."
lane :beta do
  increment_build_number
  # ...
  localizr
  gym
  # ...
end

S3 Configuration

This is optional, but you can enable this by providing valid information for the following in the environment variables.

export AWS_ACCESS_KEY_ID='Your aws access key id'
export AWS_SECRET_ACCESS_KEY='Your secret key'
export AWS_STORAGE_BUCKET_NAME='Name of the bucket'

For Non-Developers, Translators or even Developers.

How to use Localizr?

  1. Create different Locales set the name and the code.
  2. Create an App and set the base_locale if you want to have a fallback for missing localized strings.
  3. Create Different Keys.
  4. Match the Keys with the App so you can re-use the keys to other apps too.
  5. Finally, populate the localized strings .

Does it look difficult?

Then try to use the importer (csv, xls, xlsx, tsv, json, yaml).

You can find the sample csv files in the sample_data folder.

  1. Import the Locales.csv to Locales section.
  2. Import the Apps.csv to Apps section.
  3. Import the App's Keys.csv to App 's Keys section.
  4. Import the Localized String.csv to Localized String section.

import admin import

import button

import change diff

How about exporting?

Just find the EXPORT button, select the format and that's it.

Deployment

Using Heroku

Just click this button >++> Deploy

If 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:

LOCALIZR_DISABLE_AUTO_MIGRATION=1

Using Docker

sample config of docker-compose.yml

version: '3'

services:
  db:
    image: postgres:9.4
    volumes:
      - pg-data:/var/lib/postgresql/data
    ports:
      - "5432:5432"  
    environment:
      - POSTGRES_PASSWORD=your_db_password

  localizr:
    image: michaelhenry119/localizr:latest
    container_name: localizr
    ports:
      - "80:8001"
    environment:
      # Reference: postgres://USER:PASSWORD@HOST:PORT/NAME, this example is using the default postgres database.
      - DATABASE_URL=postgres://postgres:your_db_password@db:5432/postgres
      # You have to define your host name here to prevent any random attacks.
      - ALLOWED_HOSTS=0.0.0.0,localizr.domain.com,or_any_domain
      # This is optional, you can assign a default then change it later from the admin page. 
      # Or you can do it programatically after you mount the image.
      - ADMIN_USERNAME=admin
      - ADMIN_PASSWORD=change_me_later
      - [email protected]
    depends_on:
      - db
volumes:
  pg-data:

Local setup (via virtualenv)

Install virtualenv

$ pip install virtualenv

Create a virtual environment venv

$ virtualenv venv

Activate the virtual environment

$ source venv/bin/activate

Install the dependencies

$ pip install -r requirements_local.txt

Migrate to create a local sqlite database

$ python manage.py migrate --settings=project.settings

Create a super user (login account)

$ python manage.py createsuperuser --settings=project.settings

Run the local server

$ python manage.py runserver --settings=project.settings

open http://127.0.0.1:8000/ from your browser and use the login credentials you provided.

Snapshot

Snapshot is supported by passing a query param ?snapshot=your_any_key_or_build_number to the localizedkeystrings request.

Recommendation and Automation:

With 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.

TODO:

  • iOS format support
  • Android format support
  • Import/Export contents via CSV file
  • CI
  • Test cases
  • Docker container support.
  • Snapshot support.
  • Interactive UI.
  • Able to use google translate for some missing translations.

Author

Michael Henry Pantaleon, [email protected]

License

Localizr is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].