Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup i18n #137

Open
5 of 6 tasks
wvengen opened this issue Jun 20, 2013 · 5 comments
Open
5 of 6 tasks

cleanup i18n #137

wvengen opened this issue Jun 20, 2013 · 5 comments

Comments

@wvengen
Copy link
Member

wvengen commented Jun 20, 2013

Begin 2013, foodsoft has been internationalised (meaning that all texts have been replaced by identifiers, and the texts have been associated with these identifiers) and translated to English. simple_form has been used to i18n form labels, and sometimes direct t('simple_form.labels.foo.bar') was used. Now these sometimes contain duplicates, and it would be useful to normalise the data, and also to move the strings to ActiveRecord's model i18n when possible. Special cases can remain in simple_form's i18n.

See commit 98b729e for an example. Also see #84 (in particular this comment)

  • make sure there are no untranslated strings left (except in debug messages)
  • use i18n-js to translate javascript (ordering.js)
  • use i18n-js number localisation features
  • and use human_attribute_name&f
  • move model and attribute names to activerecord namespace where sensible
  • reduce duplicate translations where it makes sense
@wvengen
Copy link
Member Author

wvengen commented Oct 3, 2013

@wvengen
Copy link
Member Author

wvengen commented Oct 3, 2013

started moving keys from the simple_form namespace to activerecord in branch i18n

@JuliusR
Copy link
Contributor

JuliusR commented Oct 3, 2013

  • Is it a good practice to use e.g. activerecords.attributes.articles.price in views? This could reduce redundant translations a lot. I also like the syntax StockArticle.human_attribute_name 'name' (works with inheritance).
  • What about pseudo-attributes like fc_price? Should we also refer to them as activerecord.attributes?
  • Same questions rises for relations like StockArticle.human_attribute_name 'supplier' or t 'activerecords.models.supplier'. Well, here I would vote for referring to the attribute because a model can have different meanings depending on the kind of relation.

@wvengen
Copy link
Member Author

wvengen commented Oct 4, 2013

@JuliusR thanks! Responding to your points:

  • I have found multiple instances of it being used in views, yes I think it is meant to be.
  • I've seen people use pseudo-attributes being used by human_attribute_name; and the code allows it too. When that breaks, we can still change it. Directly referring to activerecord.attributes would be reimplementing the human_attribute_name code (incl. a call to humanize)
  • Agree om attribute name.
    I'll continue with this.

@wvengen
Copy link
Member Author

wvengen commented Oct 9, 2013

I'd like to merge current changes back into master already to minimise keeping them synchronised. Please raise any objections. One thing to look at is heading_helper.

@wvengen wvengen mentioned this issue Oct 17, 2013
wvengen referenced this issue in foodcoop-adam/foodsoft Nov 23, 2013
wvengen added a commit that referenced this issue Dec 6, 2013
wvengen added a commit that referenced this issue Dec 6, 2013
wvengen added a commit that referenced this issue Dec 6, 2013
wvengen added a commit that referenced this issue Dec 10, 2013
wvengen added a commit to wvengen/foodsoft that referenced this issue Dec 11, 2013
@wvengen wvengen modified the milestones: 4.2, 3.3 Feb 12, 2014
@wvengen wvengen modified the milestones: 4.2, 4.3 Sep 2, 2014
@wvengen wvengen removed this from the 4.3 milestone Dec 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants