Hi Richard,
Nice to see that you're willing to contribute.
The idea you present remind me a bit of gettext. I like the detection
part, but I'm not that comfortable with using real texts as keys.
They're fragile and I don't think you should keep all the strings
inside your views. Or are you suggesting that the rake file changes
the view from <%= t(".Welcome to my webpage") %> to <%=
t(".welcome_to_my_webpage") as well? I don't know if that is handy.
You are also going to have problems with longer strings, which will
clog your locale files.
I believe Zigzag Chen already did something similar with his
ready_for_i18n gem. Unfortunately, he died recently.
Remember: i18n is one of the harder problems in programming, so be
prepared for some setbacks.
Good luck!
- iain
On Tue, Jun 8, 2010 at 12:26, Richard Schneeman <[email protected]> wrote:
> Hello i18n community of rails. I've been programming RoR for a few
> years now, and want to test my chops contributing to some open source
> projects, I have a special interest in i18n and have an Idea, though i
> wanted to get some feedback on the first the validity (and usability)
> of the idea, and then second on the potential implementation (caveats,
> major problems, etc.).
>
> What I'm interested in doing is creating an backend generating rake
> task and to create the default key pair automatically so the key is
> the actual sentence in your html.erb file.
>
> For example in my code rather than have t(".welcome_message") and then
> in my en.yml have a key value pair, i could put something akin to
> t(".Welcome to my Web page") which after rake could generate the key
> value pair similar to this:
>
> welcome_to_my_web_page: "Welcome to my Web page"
>
>
> Do you think such functionality would be useful to someone getting
> started with i18n, or to a veteran having the ability to modify the
> key value pair and view the changes in the html.erb at the same time
> (keeping things a little more dry) ?
>
> If you would desire this type of functionality what types of technical
> hurdles would I expect to face? I wouldn't want special characters in
> my keys, and I also wouldn't want the keys themselves to be entire
> paragraphs, are there any other caveats you see?
>
> If this has already been tried let me know, again i'm just getting
> started "giving back" to the community, so this may not be the right
> idea, and/or project. Whatever your opinions or thoughts are please
> share them!
>
> --
> You received this message because you are subscribed to the Google Groups
> "rails-i18n" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rails-i18n?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"rails-i18n" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rails-i18n?hl=en.