Created
June 4, 2012 06:50
-
-
Save krainboltgreene/2866752 to your computer and use it in GitHub Desktop.
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
accounts_controller: | |
sign_out: | |
en: "Sign Out" | |
index_action: | |
no_ideas: | |
en: "You have no ideas, why don't you make some?" | |
es: "Usted no tiene ninguna idea, ¿por qué no hacer algo?" | |
posts_controller: | |
find_posts: | |
en: "Find Posts" | |
insufficient_funds: | |
en: "You don't have sufficient funds." | |
jp: "あなたが十分な資金を持っていません。" |
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
en: | |
accounts_controller: | |
sign_out: "Sign Out" | |
index_action: | |
no_ideas: "You have no ideas, why don't you make some?" | |
posts_controller: | |
find_posts: "Find Posts" | |
insufficient_funds: "You don't have sufficient funds." | |
es: | |
accounts_controller: | |
index_action: | |
no_ideas: "Usted no tiene ninguna idea, ¿por qué no hacer algo?" | |
jp: | |
insufficient_funds: "あなたが十分な資金を持っていません。" |
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
{ | |
"accounts_controller": { | |
"sign_out": { | |
"en": "Sign Out" | |
}, | |
"index": { | |
"no_ideas": { | |
"en": "You have no ideas, why don't you make some?", | |
"es": "Usted no tiene ninguna idea, ¿por qué no hacer algo?" | |
} | |
} | |
}, | |
"posts_controller": { | |
"find_posts": { | |
"en": "Find Posts" | |
} | |
}, | |
"insuficient_funds": { | |
"en": "You don't have sufficient funds.", | |
"jp": "あなたが十分な資金を持っていません。" | |
} | |
} |
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
{ | |
"en": { | |
"accounts_controller": { | |
"sign_out": "Sign Out", | |
"index_action": { | |
"no_ideas": "You have no ideas, why don't you make some?" | |
} | |
}, | |
"posts_controller": { | |
"find_posts": "Find Posts" | |
}, | |
"insufficient_funds": "You don't have sufficient funds." | |
}, | |
"jp": { | |
"insufficient_funds": "あなたが十分な資金を持っていません。" | |
}, | |
"es": { | |
"accounts_controller": { | |
"index_action": { | |
"no_ideas": "Usted no tiene ninguna idea, ¿por qué no hacer algo?" | |
} | |
} | |
} | |
} |
Oh, and example of the database version is things like Copycopter.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Representing the locales structure in a document database does not work if you have language as root. You end up with a finite list of root documents (languages) and infinite key/values. The other way you have infinite documents (the identifiers) with finite key/values (the locales and their respective text).
This happens anyways, you always have to bundle the entire thing into a single structure (with multiple root nodes). In this case, however, you can have infinite root nodes. I always suggest having global, controller specific, and controller+action specific.
I'm not sure that's an issue, I would have to ask a translator. You could always have a default be a specific language:
instead of
I think ultimately a preprocessor is overkill. Having simple json files with the end nodes identifying the language would require less work and ultimately less magic.