-
Notifications
You must be signed in to change notification settings - Fork 46
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
bullet_train-internationalization
#239
Conversation
We could move the locale helper here too. |
@gazayas Any idea what we have to do here to get this passing CI? |
Will have to double check on this one, I'll try to sit down with this one again sooner than later. |
@andrewculver Fixed! Since this is a joint PR, it needs bullet-train-co/bullet_train#726 and then we need to add I saw you added a joint PR tag, so I'll start adding those from here on out. How to test locally:
gem "bullet_train-internationalization", git: '[email protected]:bullet-train-co/bullet_train-core.git', branch: 'features/internationalization', glob: 'bullet_train-internationalization/*.gemspec' I had to test both the local gem with |
@gazayas Can you look at the conflicts here? And also merge/rebase |
@jagthedrummer I added the following in bullet-train-co/bullet_train@625e36a to make the CI tests pass in this PR: gem "bullet_train-internationalization", git: "[email protected]:bullet-train-co/bullet_train-core.git", branch: "features/internationalization", glob: "bullet_train-internationalization/*.gemspec" I will go ahead and revert the change though since we should be using an officially released gem. |
|
||
module BulletTrain | ||
module Internationalization | ||
VERSION = "0.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may have to update this to 1.3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we should definitely update this to match the version number for everything else.
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } | ||
spec.require_paths = ["lib"] | ||
|
||
spec.add_development_dependency "rails", "~> 7.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jagthedrummer I've cleaned up the PR a bit, but the only thing I'm not sure about right now is the gem versions that are in here and the Gemfile which are set explicitly. I don't think they should be, but just wanted to double check what you think about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gazayas I think we probably want to match whatever version constraints the other core
gems are using.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jagthedrummer Alright, what I've got here matches what we have in bullet_train.gemspec
and bullet_train-roles.gemspec
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this .DS_Store
file, or the one above it. Should probably add that to the .gitignore
.
VERSION: String | ||
# See the writing guide of rbs: https://github.com/ruby/rbs#guides | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? (I don't know a lot about rbs, but it doesn't seem like it's adopted by the project.)
@jagthedrummer Thanks for the review, I went ahead and applied the changes! |
66237d4
to
3aba77e
Compare
Hey @gazayas I was just trying to get this cleaned up and ready to merge, and then realized that I don't quite understand the goal here. What's the advantage to creating a new gem to house all of the locale files vs just leaving them where they are? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pulled down this branch and rebased against main
to get it up to date, and when I ran into merge conflicts I'm not sure that I did the right thing on these two files. Should we be removing them? (I kinda think not...)
Also, just making a note so I don't forget it. I think if we do want to move the locale file into a gem that we should do it in a multi-step process to make the merging/deployment smoother.
|
@jagthedrummer When I started translating on a personal project, I ran into the devise strings and took notes from devise-i18n. I figured if they have a gem for I18n, then we probably should too for design purposes if it's a good route to take. We could potentially also extract stuff like the locale_helper in the future. I can understand why it’s not necessary to create a new gem for it though, so I'm open to how we handle this. |
@gazayas, did the existing structure cause you any problems as you were localizing your personal project? Like was this intended to solve a specific pain you were experiencing? It looks to me like From the
If there are some real benefits to extracting a gem for this I'm definitely not opposed to it. But I'm not sure we should do it otherwise. I'm also open to persuasion. |
@jagthedrummer It's been a while so I don't remember any specific problems, and if we can't come up with any for the time being I'm ok with closing this one. We can at least consider it for the future if anything comes up. |
OK, I'm gonna close it for now since there's so much other stuff in flight. |
bullet-train-co/bullet_train#726
Namespace Collision
I originally wanted to name this
bullet_train-i18n
similar todevise-i18n
, but we were getting a namespace collision in the resolver.devise-i18n
avoids namespace collision in their repository by usingDeviseI18n
instead ofDevise::I18n
. I ended up choosingInternationalization
, and although the naming I decided to go with is longer, we can explicitly avoid the namespace collision and maintain the same structure as other gems we already have in place at the same time, so I personally think it’s a good option.Incompatibility with
devise-i18n
devise-i18n uses its own views, so although the translations are working, we're getting the same view order bug we did a while back in #33 where the original devise gem's files were taking precedence over our custom ones:
Things I would like to get done
bin/configure
script.