forked from moredip/Frank
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request moredip#63 from dnonnenm/master
Frank is not working with an operating system not using English as system language
- Loading branch information
Showing
4 changed files
with
62 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
require 'i18n' | ||
|
||
module Frank | ||
module Cucumber | ||
module Localize | ||
|
||
def self.system_locale | ||
case ENV['LANG'] | ||
when /^fr_/ | ||
:fr | ||
else | ||
:en | ||
end | ||
end | ||
|
||
def self.load_translations | ||
if I18n.backend.send(:translations).size == 0 | ||
I18n.locale = self.system_locale | ||
I18n.load_path = [ File.join(File.dirname(__FILE__), 'localize.yml') ] | ||
I18n.backend.load_translations | ||
end | ||
end | ||
|
||
def self.t(key) | ||
self.load_translations | ||
I18n.t(key) | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
en: | ||
iphone_simulator: iPhone Simulator | ||
hardware: Hardware | ||
home: Home | ||
rotate_left: Rotate Left | ||
rotate_right: Rotate Right | ||
shake_gesture: Shake Gesture | ||
simulate_memory_warning: Simulate Memory Warning | ||
toggle_in_call_status_bar: Toggle In-Call Status Bar | ||
simulate_hardware_keyboard: Simulate Hardware Keyboard | ||
|
||
fr: | ||
iphone_simulator: Simulateur iOS | ||
hardware: Matériel | ||
home: Écran d’accueil | ||
rotate_left: Rotation à gauche | ||
rotate_right: Rotation à droite | ||
shake_gesture: Secousse | ||
simulate_memory_warning: Simuler un avertissement de mémoire | ||
toggle_in_call_status_bar: Afficher/Masquer la barre d'état d'appel en cour | ||
simulate_hardware_keyboard: Simuler un clavier matériel |