All Projects → antonioribeiro → glottos

antonioribeiro / glottos

Licence: BSD-3-Clause license
A PHP 5.3+ Translation/Localization System

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to glottos

learnrxjs
Русскоязычная документация RxJS
Stars: ✭ 20 (-71.43%)
Mutual labels:  localization
socitrack
A wearable platform for social interaction studies
Stars: ✭ 16 (-77.14%)
Mutual labels:  localization
sketch-crowdin
Connect your Sketch and Crowdin projects together
Stars: ✭ 35 (-50%)
Mutual labels:  localization
textpacks
Textpattern CMS language files.
Stars: ✭ 25 (-64.29%)
Mutual labels:  localization
ngx-translate-module-loader
Highly configurable and flexible translations loader for @ngx-translate/core
Stars: ✭ 31 (-55.71%)
Mutual labels:  localization
JuliaAutonomy
Julia sample codes for Autonomy, Robotics and Self-Driving Algorithms.
Stars: ✭ 21 (-70%)
Mutual labels:  localization
go-l10n
Lightweight yet powerful continuous localization solution for Go, based on Serge and Plurr.
Stars: ✭ 32 (-54.29%)
Mutual labels:  localization
docker-compose
Docker compose for Weblate
Stars: ✭ 62 (-11.43%)
Mutual labels:  localization
iXn
Control your localization of apps
Stars: ✭ 20 (-71.43%)
Mutual labels:  localization
locale-switcher
Browser Extension to quickly change your browser locale.
Stars: ✭ 75 (+7.14%)
Mutual labels:  localization
schummar-translate
TypeScript powered translation library for React and Node.js.
Stars: ✭ 120 (+71.43%)
Mutual labels:  localization
learn flutter theme
Learn flutter theme in this project
Stars: ✭ 30 (-57.14%)
Mutual labels:  localization
resource-translator
A GitHub Action that automatically creates machine-translated PRs of translation files. Supported file formats include, .ini, .po, .restext, .resx, .xliff .json.
Stars: ✭ 44 (-37.14%)
Mutual labels:  localization
csv-localizer
Command Line Interface that convert CSV file to iOS, Android or JSON localizable strings
Stars: ✭ 84 (+20%)
Mutual labels:  localization
fuse-device
Use the basic Device functions such as UUID and current localization from Fuse
Stars: ✭ 13 (-81.43%)
Mutual labels:  localization
I18N-Portable
Simple and cross platform internationalization/translations for Xamarin and .NET
Stars: ✭ 102 (+45.71%)
Mutual labels:  localization
update localization
A Python Script that helps dealing with localizations in Xcode. It keeps track of Items that are already translated and doesnt replace them like genstrings does but appends new items. Moreover it is possible to specify extensions of files that should be scanned and to specify ignore patterns for Files that should be ignored
Stars: ✭ 39 (-44.29%)
Mutual labels:  localization
turnwing
Type safe & hackable localization library for Haxe
Stars: ✭ 39 (-44.29%)
Mutual labels:  localization
NALib
General purpose C sourcecode collection
Stars: ✭ 16 (-77.14%)
Mutual labels:  localization
MultiplatformPlayground
Kotlin Multiplatform project in Jetpack Compose & SwiftUI with shared ViewModel layer and File upload
Stars: ✭ 72 (+2.86%)
Mutual labels:  localization

Glottos

Latest Stable Version Build Status

An Online Translation/Localization System for Laravel Web Artisans

Check out Glottos Admin, a full featured site translation system built with Glottos.

A quick overview of what you are able to do with it:

// Use the Facade to set a locale

Glottos::setLocale('pt_BR');

// And just use it

Glottos::translate('Laravel is a PHP Framework');

// There's a helper

g('Laravel is a PHP Framework');

// Choose a particular locale

Glottos::translate('Laravel is a PHP Framework', 'pt_BR')

// or 

Glottos::translate('Laravel is a PHP Framework', 'pt-br')

// Glottos let you choose between keys and natural language:

Glottos::translate('key::home.describe.laravel') 
Glottos::translate('natural::Laravel is a PHP Framework') 

// or you can just define your default as natural and use:

Glottos::translate('Laravel is a PHP Framework') 

// It will break your paragraphs in sentences

Glottos::translate('Laravel is a PHP Framework. Laravel was written by Taylor Otwell.')

// To not repeat itself, it will store those two sentences in your database:

'Laravel is a PHP Framework'
'Laravel was written by Taylor Otwell'

// Removing punctuation and special chars.

// With a simple blade trick 

Blade::extend(function ($view) {

	return preg_replace(
		                 '/{{\'((.|\s)*?)\'}}/', 
	                     '<?php echo Glottos::translate("$1"); ?>', $view
	                   );

});

// You can use it beautifully in your Views:

<p>{{'Laravel is a PHP Framework'}}</p>

// You can still use the Lang Facade, Glottos has a compatible one

Lang::trans('Photography')

// And use choice

Lang::choice('Photography|Photographies', 100, array(), 'pt_BR')

Glottos::choice('Photography|Photographies', 100, array(), 'pt_BR')

// And dozens of other features, like importing your current language files

The idea behind this package is very simple: you need your web app to become multi-language fast so you better translate it all online, with some help from co-workers or the community.

Schema

Basically Glottos will create and sometimes populate a bunch of tables for

  • Countries - 127
  • Languages - 129
  • Locales - 323 - Each one with its proper regional language name
  • Messages - (is stores hashes of the primary message)
  • Translations - one row for each message x locale

Here's a view of how Laravel's messages are stored in the Admin site:

Laravel site messages in Glottos

Installation

Requirements

  • Any flavour of PHP 5.3.7+ should do
  • [optional] PHPUnit to execute the test suite

Frameworks

Since Glottos depends on data layer it is a Laravel 4.x ready package, but it was coded to be as much agnostic as possible, so you can create new drivers and use it on your own frameworks. You can even send me PRs to add them to the main code.

With Composer

composer require pragmarx/glottos dev-master

Once this operation completes, add the service provider to your app/config/app.php:

'PragmaRX\Glottos\Vendor\Laravel\ServiceProvider',

Migrate Glottos tables:

php artisan migrate --package=pragmarx/glottos

Import your current language files:

php artisan glottos:import

And you should be good to go. Enjoy!

TODO

  • Add a real cache layer to it.
  • Add more frameworks and data access drivers.

Author

Antonio Carlos Ribeiro - [email protected] - http://twitter.com/iantonioribeiro

### License

Glottos is licensed under the MIT License - see the LICENSE file for details

Contributing

Pull requests and issues are more than welcome.

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