Forum: Ruby-Forum.com Translating RForum - all the quirks

Fc313ff555a886a9e5c706a985688939?d=identicon&s=25 Norbert Bognar (trebron)
on 2006-04-28 17:25
I've recently made a Hungarian translation. In the process I had to face
the fact that translating the language.yaml file is far from enough, as
numerous strings are scattered in various rforum files. I made a list to
help fellow translators. And I definietly hope that I don't have to
start all over again translating with 0.3, these should be moved to a
language.yaml file sooner or later. hint-hint ;)

Here are my findings (I think it's not documented elsewhere):


1) first of all lang/yourlanguage.yaml

1b) family and first name order.
> in my language it is in a reverse order compared to english, so i had to hack this in 
hu.yaml, as otherwise it would had been too difficult, as there are many surname and 
firstname string in the rforum files

2) emails
> app/views/mailer/yourlanguage

3) â??blockedâ?? (IP address blocked feedback)
> app/controllers/application.rb

4) â??IP is already in block listâ??
> app/controllers/admin_controller.rb

5) â??User informationâ?? page name at top (clicking on the user list and
then on a user)
> app/controllers/user_controller.rb

6a) â??Editâ?? (in the forum list, if the logged in user is an admin)
> app/views/forum/list.rhtml

6b) â??[add]â?? string after Available Forums if logged in user is an admin)
> app/views/forum/list.rhtml

7a) â??Save / delete forumâ?? + confirmation (buttons in the forum edit menu
for admins)
> app/views/forum/edit.rhtml

7b) â??Name, descriptionâ?? (text in the forum edit menu)
> app/views/forum/edit.rhtml

8) â??Searchâ??, â??Search resultsâ?? (Button in the search menu, results)
> app/views/forum/search.rhtml

9) Date format (depends on format_datetime)
> app/helpers/application_helper.rb

10) â??Forum:â??, â??Subject:â??, â??Text:â??, â??Submitâ?? buttons, 
â??anonymousâ?? user,
email as well (when posting)
> app/views/topic_postform.rhtml

11) â??authorâ??, â??dateâ??, â??guestâ?? (at the top of posts)
> app/views/topic/_post.rhtml

13) "<user> wrote:" string when replying with quote
app/controllers/topic_controller.rb
38007b98b4915b915e1be2480c886f2f?d=identicon&s=25 Stian H (Guest)
on 2006-07-12 11:38
Excellent, thanks for the listing :) I am working on a norwegian
translation, and it's pretty much done (the no.yaml). However I am
getting some errormessages when trying to fire up WEBrick when using
special norwegian characthers (that are indeed needed) in the
translation. A copy/paste follows, any suggestions are welcome :)

stian@x303:~/rails/rforum-0.2$ RAILS_ENV=production script/server
=> Booting WEBrick...
./lib/localization.rb:51:in `iconv': "øk" (Iconv::IllegalSequence)
        from ./lib/localization.rb:51:in `load_localized_strings'
        from ./lib/localization.rb:50:in `load_localized_strings'
        from ./lib/localization.rb:49:in `load_localized_strings'
        from ./lib/localization.rb:42:in `load_localized_strings'
        from ./config/app.rb:16
        from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require'
        from ./config/environment.rb:52
        from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require'
        from
/usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/commands/servers/webrick.rb:52
        from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require'
        from
/usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/commands/server.rb:30
        from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from script/server:3
stian@x303:~/rails/rforum-0.2$
Fc313ff555a886a9e5c706a985688939?d=identicon&s=25 Norbert Bognar (trebron)
on 2006-07-12 12:47
I had the same problem with accented characters, fortunately I could
figure out the solution. Check the file lib/localization.rb and make a
small correction.

Search for the line containing

file_charset = hash[â??file_charsetâ??] || â??asciiâ??

and change ascii to â??utf-8â??.

I hope it helps, it worked for me. :)
38007b98b4915b915e1be2480c886f2f?d=identicon&s=25 Stian H (Guest)
on 2006-07-12 13:14
> Search for the line containing
>
> file_charset = hash[â??file_charsetâ??] || â??asciiâ??
>
> and change ascii to â??utf-8â??.
>
> I hope it helps, it worked for me. :)

Excellent, that worked perfectly thanks :D
3a83969376c805ef5b6042191fdb0ff3?d=identicon&s=25 Andreas S. (andreas)
on 2006-07-12 17:32
Stian H wrote:
>> Search for the line containing
>>
>> file_charset = hash[â??file_charsetâ??] || â??asciiâ??
>>
>> and change ascii to â??utf-8â??.
>>
>> I hope it helps, it worked for me. :)
>
> Excellent, that worked perfectly thanks :D

A better solution is to add a key "file_charset: utf-8" to the language
file.
38007b98b4915b915e1be2480c886f2f?d=identicon&s=25 Stian H (Guest)
on 2006-07-12 21:07
> A better solution is to add a key "file_charset: utf-8" to the language
> file.

Great, I've completed my translation, and included this. And it works
great. If anyone is interested in the Norwegian Bokmal translation it's
available for grabs here:
http://konspirasjon.net/i18n/rforum_120706_nb.yaml
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.