Opened 11 years ago

Closed 12 months ago

#1946 closed defect (duplicate)

Make languages.yml translatable

Reported by: avar Owned by: rails-dev@…
Priority: major Milestone:
Component: website Version:
Keywords: Cc: StefanB


Currently the languages table (read from config/languages.yml) only has entries for language code, english name and native name.

 code         | character varying(255) | not null
 english_name | character varying(255) | not null
 native_name  | character varying(255) | 

It should be possible to translate this table into arbitrary native languages, so that when reading the diaries one sees "{{language_name}} ({{native_name}})" instead of "{{english_name}} ({{native_name}})". Where language_name is the name of the language in the locale the current user is using.

This would require changing languges.yml like so:

-  english: German                                                                                                                                           
-  native: Deutsch                                                                                                                                           
+  en: German                                                                                                                                                
+  de: Deutsch                                                                                                                                               
+  is: Þýska

And changing the languages table to something like:

 code         | character varying(255) | not null
 code_to      | character varying(255) | not null
 name         | character varying(255) |

Attachments (1)

i18n_data-plugin.patch.gz (186.2 KB) - added by StefanB 11 years ago.
adding i18n_data plugin with example use for consideration

Download all attachments as: .zip

Change History (12)

comment:1 Changed 11 years ago by StefanB

How about using ready-made data in a RoR plugn, such as: ?

There are several other, similar plugins.

comment:2 Changed 11 years ago by stefanb

Resolution: fixed
Status: newclosed

(In [15900]) Added localized language names with plugin from (fixes #1946) Diary entries in same language linked (lists and rss)

comment:3 Changed 11 years ago by Tom Hughes

Resolution: fixed
Status: closedreopened

Thank you for making the trunk undeployable - please do not make major changes like adding new plugins without consulting first.

For the record the situation with languages.yml was a result of a deliberate decision made at the hack day. In hindsight that decision needs reviewing I agree but it needs more thought than has gone on here to decide on the best solution so please leave this open until I am back from holiday.

comment:4 Changed 11 years ago by Tom Hughes

I have backed out r15900 for now.

comment:5 Changed 11 years ago by StefanB

I thought announcing it here and seeing no objections meant that the plugin was acceptable.

Just of curiosity, why was it undeployable? Was it technically broken in some way, or just socially not agreed enough upon? Don't want to make the same mistake again.

Can I redo other changes that are not requiring the plugin?

No rush though, enjoy your holidays!

comment:6 Changed 11 years ago by StefanB

Cc: StefanB added

comment:7 Changed 11 years ago by Shaun McDonald

As the admin of the server is on holiday he hasn't had time to check the plugin to see if it is suitable, and doesn't have any bad side effects or if there are better alternatives.

Less than 24 hours is rarely enough time during a normal working week to review a big change in the code, never mind when the main sys admin is on holiday.

At the moment we are only accepting small bug fixes into trunk. Generally major changes are done in a branch so that trunk is always deployable. Even if the branch only lasts a few days or weeks, it still means that trunk can always be deployed if there are any urgent bugs that need to be fixed, or there are other code changes that can be deployed straight away.

comment:8 Changed 11 years ago by stefanb

(In [15916]) minor change: diary entries per language linked (lists and rss feeds) (again, since r15900 was rolled back in r15905, see #1946 - this time without adding a plugin)

Changed 11 years ago by StefanB

Attachment: i18n_data-plugin.patch.gz added

adding i18n_data plugin with example use for consideration

comment:9 Changed 11 years ago by StefanB

smsm1, thanks for clarification!

I've split the reverted r15900 into a trivial part (checked in as r15916) and the non trivial part (attached patch i18n_data-plugin.patch.gz) to be considered as one of the options when resolving this issue later on.

comment:10 Changed 9 years ago by Tom Hughes

Owner: changed from Tom Hughes to rails-dev@…

comment:11 Changed 12 months ago by Andy Allan

Resolution: duplicate
Status: reopenedclosed
Note: See TracTickets for help on using tickets.