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

Creating locale for pt-BR (Brazilian Portuguese) #141

Closed
wants to merge 3 commits into from
Closed

Creating locale for pt-BR (Brazilian Portuguese) #141

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 15, 2015

With this commit the application will have a pt-BR locale
available for usage.

I've tested using the sandbox application pointing to my GH fork and it was ok.
Also, I've noticed that some interface items (like the 'Created' button) is not on the translation file.
Whenever you make changes or add new translation items, feel free to ping me for updating the translation.

With this commit the application will have a pt-BR locale
available for usage.
@Linuus
Copy link
Contributor

Linuus commented Nov 15, 2015

Awesome @ramirovjr Thank you very much.

Which "Created" button do you mean is not translatable?

@ghost
Copy link
Author

ghost commented Nov 15, 2015

The one at the top of resource and I think it's 'Create' (sorry for posting the wrong label of the button)

@Linuus
Copy link
Contributor

Linuus commented Nov 15, 2015

@ramirovjr I see. It is defined here:
https://github.com/varvet/godmin/blob/master/app/views/godmin/resource/_button_actions.html.erb

It uses the default translation from Rails, for creating models (helpers.submit.create), so it should pick it up from the regular locale file. We've never had the need to translate this separately so we just piggy backed on Rails. Would it be useful for you to be able to do that?

As detailed in the PR comments, I'm adding to the translations
a key to enable the translation of the 'Create' button. Added
the key to all the translation files available.

refs #141
After creating the translation key for the 'Create' button, 2 tests
were failing. Fixed by changing the reported lines to match the label
defined in the translation file.

refs #141
pt-BR:
helpers:
submit:
create: Novo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should add any translations outside of the godmin scope. It will affect the entire site. If we want these to be translatable only in godmin we should add specific translations for them inside the godmin scope.

You can just include the appropriate locale file and it will be translated. See:
https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/pt-BR.yml#L133-L139

Can you revert these changes and squash it into one commit please?

@ghost
Copy link
Author

ghost commented Nov 16, 2015

Yeah, no problem.
I'll do it tonight.

@Linuus
Copy link
Contributor

Linuus commented Nov 18, 2015

@ramirovjr I cherry-picked your commit directly instead :) So no need for squashing.

Thank you for the contribution!

@Linuus Linuus closed this Nov 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants