Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Break out translations for rails 2.3 and rails 3 #151

Closed
tigrish opened this Issue · 15 comments

4 participants

@tigrish

I'm wondering about what the structure would look like if rails 2.3 and rails 3 translations were separate.

I can see a few advantages to marking a separation :

  • We only need to include localizations for 1 version - we can remove the current duplication/aliasing between versions.
  • The two files can evolve independently - rails 2.3 has been parked, rails 3 is the current and maybe we can think about having a "pre" branch for upcoming rails implementations. The main point is that we should be able to evolve without having to think about breaking backwards compatibility.

I'd be happy to generate the files for each version and for each locale if there's interest in this, my question is more what should the folder structure look like?

As a side note, I see this as being a workable solution to fix #127 and #136 - just saying' :)

@ariejan
Collaborator

+1 - I think this would be a good idea. It keeps things simple.

@kuroda
Collaborator

+1

I think we should make full restructuring of the source tree taking this opportunity and bump the version to 1.0.0.

I have a question as a gem package maintainer: should we create two separate gem packages? Please advise me.

@tigrish

@kuroda - what would make the most sense to me with regards to version numbers is that it would mirror the rails version.

In my Gemfile I'd want to do some thing like

gem 'rails-i18n', '>= 3'

or

gem 'rails i18n', '2.3.10'

@ariejan
Collaborator

@tigrish - No mirror version numbers would be a bad idea. I would propose a structure like this:

1.x - Compatible with Rails 2.3.x
2.x - Compatible with Rails 3.x
3.x - Compatible with Rails 4.x

@tigrish

OK, maybe I'm confusing git branching and tagging with the gem version number.

I think my point is that as a user I shouldn't have to know rails-i18n's numbering structure to be able to pull translations for a specific rails version.

@kuroda
Collaborator

Hi, all

I've just created a new branch restructuring. Let's begin our experiments on this branch.

As for the version number, I agree with ariejan. I will ship a new gem with version like 1.0.0.pre or 2.0.0.pre and wait comments from the public.

@kuroda
Collaborator

@tigrish

How is the situation of this issue? Can I close it?

@tigrish

I'd need to remove the translations that are only used for 2.3; I think this is mostly just the activerecord namespace but I'll check if there are any others.

@kuroda
Collaborator

OK. I will keep this issue open.

@tigrish tigrish referenced this issue from a commit
@tigrish tigrish Remove the active record namespace
I imported to Locale to make these changes and subsequently exported :

- Firstly, all files have been scrubbed of comments and extra spaces.
- Secondly, keys are sorted alphabetically (means diffs can be produced
between de.yml and de-AT.yml for example).
- Finally, they are output by Psych directly, so they are 100% YAML 1.0
compatible in the strictest sense.

Whilst in Locale :

- Removed the active record namespace
- Completed some missing translations for en-IN

Closes #151
21c8006
@kuroda kuroda closed this issue from a commit
@tigrish tigrish Remove the active record namespace
I imported to Locale to make these changes and subsequently exported :

- Firstly, all files have been scrubbed of comments and extra spaces.
- Secondly, keys are sorted alphabetically (means diffs can be produced
between de.yml and de-AT.yml for example).
- Finally, they are output by Psych directly, so they are 100% YAML 1.0
compatible in the strictest sense.

Whilst in Locale :

- Removed the active record namespace
- Completed some missing translations for en-IN

Closes #151
21c8006
@kuroda kuroda closed this in 21c8006
@kuroda kuroda reopened this
@kuroda
Collaborator

@tigrish

I just merged your commits. But, I think I should have thought about it more carefully.

Rails master's activerecord/lib/active_record/locale/en.yml has still activerecord namespace. Could you explain why we can do without it?

Secondly, I think you should move old translations into another directory so that users can find them easily.

@tigrish

Hi @kuroda ,

The motivation for removing the activerecord namespace is to make the messages available to multiple ORMs - think activerecord and activemodel by default as detailed here http://blog.plataformatec.com.br/2010/02/rails-3-i18n-changes/

I suggest that the translations on rails master should be updated to reflect this too :)

BTW, I missed the support.select deprecation, will remove this namespace too.

I can move the old translations into another directory if you like, although isn't this what versioning is for? Maybe a better solution would be to publish a new branch for these "legacy" translations?

Also, I'd like to remove the "fun" directory from the master branch since these translations seem dated and are hard to maintain. Any thoughts?

@kuroda
Collaborator

@tigrish

OK. Now I've got clearer outlook.

I agree with you about the creation of new branch for legacy translation. I will work on that ASAP.

And, yes, please remove the "fun" directory.

@kuroda
Collaborator

@tigrish

Created a new branch rails-2-3. You can remove the old translations.

We should add some instructions for Rails 2.3 users, then.

@kuroda
Collaborator

I think we can close this issue now.

@kuroda kuroda closed this
@amatsuda

@tigrish @kuroda

The motivation for removing the activerecord namespace is to make the messages available to multiple ORMs

I understand your motivation, I'm also :+1: for keeping things simple, but, oh please don't remove activerecord and activemodel namespace from the yamls until you actually commit that change on ActiveRecord.
Current rails-i18n master stopped working with edge Rails, which should never happen...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.