Project

i18n_redis

0.01
No commit activity in last 3 years
No release in over 3 years
I18n YAML to Redis Management.It convert exising yaml to redis.Provides various helper methods to add,update,remove,create,copy master to another locale,one locale to another locale etc.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 3.0.0
 Project Readme

i18n_redis gem

Gem is use full migrate existing YAML based i18n solution to Redis based solution.

Requirement

  • redis server
  • redis gem
  • gem 'i18n_redis'

Methods

Connect to redis databse using redis gem.

I18nRedis.connect

Convert Existing YAML To Redis Database It can be use full for any YAML to Redis

I18nRedis.yaml_to_redis(yaml_file_path)

Add new locale

I18nRedis.add_locale(name,value)`

e.g Add us locale

I18nRedis.add_locale("us")

Add us locale for id id may be user id company id etc.

I18nRedis.add_locale("23","us")

Get all locale It will return locale hash.

I18nRedis.get_locales

Remove locale

I18nRedis.remove_locale("us")

Add Key

I18nRedis.add(key,value,locale)

I18nRedis.create(key,value)

Remove Key

I18nRedis.remove(key,locale)

I18nRedis.destroy(key)	

Find Key

I18nRedis.find(key)

Find all for locale

I18nRedis.find_all_for_locale(locale)`

I18nRedis.find_all(key)

Copy one locale to another locale

I18nRedis.copy_locale_to_other(src_locale,dest_locale)

Clone data for all locale It will load master data to all present locale

I18nRedis.clone_data_for_all_locale(i18n_key,master_locale="en")

Update Missing key from master data

I18nRedis.create_missing_keys_for_locale(src_locale="en",dest_locale, key_value)    

Search and Replace I18n Value

I18nRedis.search_and_replace_word(search_value,replace_value,locale=nil)

If locale is nil it will replace all value otherwise it will replace for particular locale