Translating RForum - all the quirks


#1

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 :wink:

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

  1. emails

app/views/mailer/yourlanguage

  1. â??blockedâ?? (IP address blocked feedback)

app/controllers/application.rb

  1. â??IP is already in block listâ??

app/controllers/admin_controller.rb

  1. â??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

  1. â??Searchâ??, â??Search resultsâ?? (Button in the search menu, results)

app/views/forum/search.rhtml

  1. Date format (depends on format_datetime)

app/helpers/application_helper.rb

  1. â??Forum:â??, â??Subject:â??, â??Text:â??, â??Submitâ?? buttons, â??anonymousâ?? user,
    email as well (when posting)

app/views/topic_postform.rhtml

  1. â??authorâ??, â??dateâ??, â??guestâ?? (at the top of posts)

app/views/topic/_post.rhtml

  1. " wrote:" string when replying with quote
    app/controllers/topic_controller.rb

#2

Excellent, thanks for the listing :slight_smile: 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 :slight_smile:

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:inload_localized_strings’
from ./lib/localization.rb:50:in load_localized_strings' from ./lib/localization.rb:49:inload_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:inrequire’
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:inrequire’
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:inrequire’
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:inrequire’
from script/server:3
stian@x303:~/rails/rforum-0.2$


#3

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. :slight_smile:


#4

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. :slight_smile:

Excellent, that worked perfectly thanks :smiley:

A better solution is to add a key “file_charset: utf-8” to the language
file.


#5

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. :slight_smile:

Excellent, that worked perfectly thanks :smiley:


#6

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