A Rosette TMS (Translation Management System) that stores translations to disk (as opposed to a 3rd-party service). Think of this project like you might ActiveSupport::Cache::FileStore. Instead of integrating with a 3rd-party TMS like Transifex or Smartling to handle translation management, this project allows you to manage translations yourself and persists them locally to disk. As such, this TMS should usually be regarded as something only used during testing and development, as there isn't any nice interface exposed to translators.
gem install rosette-tms-filestore
Then, somewhere in your project:
require 'rosette/tms/filestore-tms'
This library is generally meant to be used with the Rosette internationalization platform. It provides a TMS that is capable of storing phrases and translations locally on disk. TMSs are configured per repo, so adding the filestore TMS might cause your Rosette config to look like this:
require 'rosette/core'
require 'rosette/tms/filestore-tms'
rosette_config = Rosette.build_config do |config|
config.add_repo('my-awesome-repo') do |repo_config|
repo_config.use_tms('filestore') do |tms_config|
tms_config.set_store_path('/path/to/store/location')
end
end
end
In addition to implementing the Rosette::Tms::Repository
interface, the filestore TMS has a method capable of storing translations. This should make it straightforward to add new translations, something that's usually done by 3rd-party translators.
locale = Rosette::Core::Locale.parse('es')
phrase = Rosette::Core::Phrase.new('Hello, world', 'hello_world_str')
rosette_config.tms.store_translation('Hola mundo', locale, phrase)
This project must be run under jRuby. It uses expert to manage java dependencies via Maven. Run bundle exec expert install
in the project root to download and install java dependencies.
bundle exec rake
or bundle exec rspec
should do the trick.
- Cameron C. Dutro: http://github.com/camertron