-
Notifications
You must be signed in to change notification settings - Fork 260
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
Spanish translation #413
Spanish translation #413
Conversation
Thanks again for submitting this. Of course all of us here are figuring this out as we go, but having something to start from (like this PR!) will definitely help move things forward. I'm taking a look at the error messages... The translations/locales aren't being found/used yet by the app, including the new "EN-en" locale. So a lot of phrases that rely on the translation system already (someone was thinking ahead?), are now saying "translation missing". The errors actually have to do with expected English phrases on the various pages not being found. Example: Here the automatic test wants to try to submit a spam-like restroom to Refuge Restrooms...and the test tries to click a button with the words "Save Restroom" in it...
but it actually says "translation_missing," not "Save Restroom" We just need to figure out how to load the translations in properly and the errors should all be fixed. And we probably want to find a way to run the automatic tests with different locales set. |
Oh - that makes sense. Perhaps it would be wise to hold back on organizing them into folders for now and just have all of the translations in locale folder. Or at lesst the original english versions ehich would be the logical thing to do. I think I’ll read documentation on best practice and try again! (prob should have done that before hand 🙄) Thanks!!! |
sorry about typos writing from |
Hi again, I have actually been working on troubleshooting this, and I have to admit I am learning most of it from scratch. Anyways, I have been following this guide as closely as possible: https://phraseapp.com/blog/posts/rails-i18n-guide/ I now understand how to include the files even in subdirectories. In my testing so far, that makes the errors go away! To see what I did, here is the commit I posted on my working branch: DeeDeeG@5e15069 I think the subdirectories are a nice organizational tool, so if you are just as happy to keep the new subdirectories as they are, this should do the trick. If you like, you can copy the changes yourself, or since I am a maintainer, I can even push that change to your branch. Anyway, once we're past this small hurdle, I think (if I understand correctly) we'll be more than half-way to working translations. |
Hi, this is awesome! Thank you for taking the time to investigate! This is a great learning curve for me. I will take a look at the options you mentioned. I'm not sure what's the best practice for work-flow. Am gonna try it out a bit and see. If I have any problems I'll let you know! |
Yay! Checks have passed. Whew. |
Way cool, this is working now. Well, the translations can be merged into the repo, and our tests all pass, which is the major first step, but we apparently still have to teach the app to know when to switch languages. I tried loading this branch of the app in Vagrant [steps here], and then visiting the site with Firefox having the es-ES locale set (from [here]), and the site just gave me the default language, i.e. English. I still think we're more than half way there, so once we figure out those next steps, we should have Spanish up and running. And as @cllns mentioned in #396 it would be very easy to add translations for other languages at that point. (Do you prefer we merge this Pull Request now, and start another issue/PR for teaching Refuge to switch languages? We can try to work everything out in this PR if you want to make sure it all works 100% before merging your translations. Not sure how tricky that will be, but I think we'll figure it out. Thoughts @tkwidmer, @mi-wood, @cllns?) (Again, very glad to have your contribution, and I'm glad to know the learning curve is right. I think we are always glad to see folks learn, and I know I learned much of what I know about Refuge's technology while working through issues on the issues page!) |
Can we get a second person who knows Spanish to take a look at this? I’m good with merging after that and having a separate effort for detecting browser language. Thanks both of you for the work! |
@MatheusFreitag, I know We do like to try and have everything cross-reviewed before posting it to the app and I'm not really sure how many people looking at our GitHub page can speak Spanish. In any case, if it comes down to it, a few hours going over it in Google Translate (and isolating shorter phrases that way) would be able to show word-for-word what the translations say, so it's not impossible to have a reviewer who doesn't speak Spanish well... I kind of understand Spanish when I read it, and Google Translate would help me to be more confident. Looking beyond this PR: There might be languages where we can't find a second reviewer, so having a reproducible process for that scenario seems like a good idea IMO. |
Maybe it needs an in-app a language switcher? I'm good with going with whatever is best for the progress of the app! |
@DeeDeeG Am still tring to find a way to install vagrant/ vb in my very old mac without it crashing :( so wasn't able to test in my local environment. |
@Intimaria sorry to hear about the crashes. Thanks for trying to test on your machine. I wonder whether you have an Intel or PowerPC mac? And what version of OSX/macOS it has? It might work with an older version of Virtualbox/ an older version of Vagrant from around the time your version of OSX was discontinued. Beyond that... I know of a solution that might work, but it would be about ten times as much effort... I mention this not because it's a "very reasonable" solution, but because it's "a" solution. If you have a lot of free hard-drive space and an empty 2GB+ USB stick, you can install Linux alongside OSX, and run Vagrant from Linux. (I use an old netbook that had Windows on it, but now it only runs Linux, and that has been working fine so far. I think most of the contributors/team here use mac, but a few use Linux.) Here is a guide for installing Ubuntu alongside OSX: https://www.lifewire.com/dual-boot-linux-and-mac-os-4125733 I would call that a weekend project, because it would probably take a while to get through it for the first time. No obligation to do it, of course, (nor do I know for sure whether it would work, depending on how well-supported the particular model of mac you have is with Linux.) I just thought I would mention the possibility of doing it. Weirder suggestion, but with less risk of overwriting your existing data: If you can get virtualbox running on your mac... you can install Ubuntu in a virtual machine, then boot into that virtual machine and install Vagrant/Virtualbox on it. The performance might be really bad, but again, these aren't supposed to be "reasonable" soluions, just the ones I can think of. Guide to get Linux instaled in Virtualbox on a mac: https://www.engadget.com/2009/09/07/how-to-set-up-ubuntu-linux-on-a-mac-its-easy-and-free/ All told, we definitely understand if the machine you have isn't able to run the test setup. Vagrant and Virtualbox are each a little fiddly to get working. I have a computer with Windows Vista that just totally refuses to run Vagrant whatever I do :/ |
@DeeDeeG I have mid 2010 intel macbook pro - was on yosemite, because of the big scary viruses have updated it to 10.13 high sierra and knock on wood it keeps working - seems OK so far. This model has a weird EFI issue which doesn’t allow for an easy time with dual boot (have spent a few weekends trying, lol), and is having some constant kernel panics whenever it has to use the nvidia graphics card so have to do some frantic switching around and use only certain programs, but there’s life in the old dear yet! I will have access to a machine running linux very soon so I will attempt again at that stage, and wow - thanks again for all your input! |
@Intimaria You could also set the environment up manually if you're okay with doing a bit of work. Assuming you have homebrew, you can
|
Yes! @stardust66 I have set up a rails based local server in my computer before, so that should work! Thanks for that advice. I will check out how I set that up previously so I don't install things that might clash with what I already have going on :) |
When looking at @stardust66's PR over at Intimaria/refugerestrooms:#1, I noticed that we have some pages that aren't translation-ready. We need to update:
That would involve taking "hard-coded" sentences and phrases and moving them into a |
@Intimaria I think it would be good to set up the locale sub-directories in the main |
This is going to be a long comment about unimportant stuff, but the locale codes in this PR are a little peculiar. I've been seeing a lot (maybe too much? :P ) of these codes when reviewing #420 and working on #419... and so I'm getting them burned into my brain a bit. Anyway: Here's the official format for these codes: So, currently in this PR we have and Since most developers of Refuge thus far are United States-ians (at least the ones who wrote text into the app), our English is probably pretty safely of the The Spanish, given how carefully you've avoided regionalisms, is probably pretty safe to categorize as a generic So in short, we should probably switch the files/folders to be
(I think the solution in #420 is capable of ingoring the |
Hi - thanks @DeeDeeG , so much to comment on. I'm a bit lost to be truthful but am getting there. Thanks for the patience.
I'm glad you pointed out the folder names as this was going to be my next question - what would you prefer to call the folders? And, also, how relevant do you feel regionalisms may be in regards to the users (also projecting into the future)? I think I used quite generically named folders as a starting point, based on my experience translating in wordpress, and you make a good point re en_EN - it is not in fact used in that format in rails and so it should be changed. Regional clarifiers may be useful in the long term, if more translations come in that are region specific. I'm happy to go with what you prefer, as long as they default to the main language when needed. In fact, as you mention, it could be that just
OK, I'm happy to do this, but am not sure about the work-flow. I can give it a go in order to learn, as I really want to learn git better, but if I can't get it right I would be very happy for you to do it, credit or not. I understand I need to make a new branch - with the folders (without the current translations added?) with the correct names,
Is this something I need to do right now or is that something that needs to be done previous to my translating them? Does that need to be done in this PR? If this is done I am happy to supply further translations. |
Translation to Spanish is still being reviewed in RefugeRestrooms#413
Whoops, I may have info-dumped a bit excessively in this Pull Request. 😅 (I tend to do that!)
|
My idea for this new pull request was to prepare the main develop branch to receive new translations in an organized way, with the sub-folders and everything. So I envision it would:
I will also try to give some info on the git commands that would be useful for this. (See below): There are a lot of resources listed here on our "wiki", by the way: Newcomers' Guide#further-learning-about-git Especially this cheatsheet if you are short on time: Spanish, English The most helpful thing for me is to know what branch I am on, and what's up with that branch:
Changing branches is done with
If you ever need to delete commits, you can use
And of course, the basics, which I'm pretty sure you already know:
Managing branches...
|
Oh wow, so much new info, thank you! I found this guide via your links which I love because it's for somewhat experienced beginners like me. Most guides assume you're starting from zero and don't account for some of my actual questions lol 💯 So, I made a new feature/lang_folders branch and initiated pull request #422 But the application.rb file shows conflicts both there and here - I tried updating it manually to what it is on the main branch. I seem to be missing a step, perhaps am not fetching upstream content correctly or missing something. Either I'm not sure how to pull from the new changes from the main upstream branch or am not doing it right. Is Have been able to install vagrant and virtual box in a friend's mac, so will attempt the testing as soon as I can. |
Also, about and business info sections are already translated in this PR. 👍 |
Thanks for the continued work, and congrats on the learning! I am very busy this morning, so I will try to take a real look at these commits later, but I am glad to see all this progress coming together. Very glad to hear the resources in the wiki were helpful! |
A
Bonus commands:
|
OK, thank you for continuing to help. And I really appreciate it! Am also a bit busy this w-e so will check back in a little while. I will have a go at those commands as and when. |
Should I try to simplify some of the commits here too, as in #422? Following from the instructions there, and fiddling about a bit, I've made my local develop branch a copy of the refugerestrooms upstream in it's current state. I also made a local version of the feature/lang_folders for #422, and just for safety I copied the translations that I did for this PR, which were in my local develop branch, into a branch called "Spanish". (I ended up having to do the changes in #422 a little bit differently to your instructions as I was getting some error messages, but it all ended up fine and I learned a bit more along the way. Like for instance, git makes it easier to configure a local branch to push to a specific remote branch if your working branch and the remote branch are named the same. So local working branch for #422 which was called "folders" didn't want to push to feature/lang_folders, until I renamed it the same and git made the magic happen.) I wonder if I should ask more questions 🤣 Some of my doubts...
Thank you so much for your committed and ongoing support! PS: this answer from here helped: this command
|
[Edit: Oh my, this comment is so long. How about a summary: Simplifying this PR sounds like a good idea. Any way that works to do so is fine. You may even start a new PR if you find that convenient. We'll work with you and try to be helpful regardless. Okay, original comment is below.]
Sure, that seems like a good idea.
That's fine, and you might find that dealing with this is surprisingly easy. When you add a remote without a nickname, it gets a default nickname, I think.
Anyways, no worries. You can delete a remote and re-add it with whatever nickname you want.
(About remotes: Just so you know, adding + fetching remotes is a lot like making sure your local folder "knows about" a remote repo. It lets you have access to the remote repository's contents (by keeping a local copy), even if you lose internet connection. Your local branches and the remotes you add are, by-and-large, kept separate. Remotes don't affect your branches unless you tell them to, and remotes only affect local branches at the moment when you tell them to. And getting rid of a remote does not change commits on local branches. The only work you might have to do if you delete a remote is re-configuring some of your local branches to track a remote again, so you can conveniently
(And in a pinch you can just
From what it sounds like you are saying, this makes perfect sense to me. If you want to change your own (Long aside:The choice here, from my perspective, is whether keep going in this PR, or open a new PR, since an existing Pull Request on GitHub can't be switched to point to a different branch than it originally pointed to. In other words, if you want to keep all comments about this work in one place, PR #413, you would have to do the work for this PR in your (Well, this could switch to being merged into a On the other hand, I would normally encourage someone to begin a new separate branch (branching off from upstream develop) for each Pull Request. That keeps (Getting a little philosophical here: It's not a big deal. One of the weird things with Git and GitHub is there are always 10x more ways to do something than anyone strictly needs. It can feel (and become) complicated just because there are so many options. In the end, people just end up finding/doing something that works for them, and it works out fine. As long as what you're doing is working, and your brain isn't telling you "there must be a better way!", you can just do what you're already doing.) (A heads up: This branch may need to be reworked again some time in the future, to take advantage of other PRs for supporting translations, such as #420. So I hope you don't mind the complexity and needing to keep updating things! Generally speaking, as long as your translations are safe somewhere, you won't have to worry about losing progress. And things ought to settle down soon, in terms of other PRs merging into
You bet! 👍 🎉 |
Thank you! This what I understand might be best from your comment: Based on me having originally started this PR with my develop rather than a specialized branch... If I push my local I could then keep my (My local However.... If I for whatever reason wanted to keep this PR (maybe because it's got so much good information in it 🤣 ), this is where all the questions arise as I did a PR from my develop branch & this perhaps complicates things a bit. So for instance,
|
I agree with everything you say here. It all makes sense to me, even having the sort-of defunct local branch, given the circumstances.
You could, and that's correct about not matching upstream anymore.
Okay, well... It's all going to involve some work if you keep the original commits. However, if you use the simplified commits in your
[Edit to add: As long as there are no merge conflicts, there is no need to keep up to date with upstream
Pushing a branch to your GitHub copy of I have to admit, I dont understand the phrase "merging them in the remote." If you mean: "Do a merge locally, from one branch into the other, then push that merged result to your GitHub If you mean "using GitHub.com to merge the two branches," I guess merging two of your own branches using GitHub.com is possible? But I haven't tried it. You could run a Pull Request from your I have a huge post getting into explaining merging and related techniques, but I thought I'd focus on your actual questions first! I do love getting into the technical details, as you might have noticed! See comment below for all kinds of tech stuff about kinds of merges. |
[Here's as summary, before I post this: The simple way to get compatible with upstream Other stuff, such as Full post below.] Well, it seems like explaining more of some basic concepts more clearly could be helpful here. About commits:The first commit in a repo "adds" all the files that are in the repo at the time of the first commit. Every commit after the first commit must be a set of changes to those existing files, and/or must add a new file, and/or must delete an existing file. ("empty" commits are possible, but they're pointless.) Fun fact: every commit contains a note of what commit(s) it is based on top of. (Regular commits are based on top of the previous commit in the same branch. Special "merge commits" are made when you do a complex merge; Merge commits are listed as being made on top of the two commits, one at the end of each branch, at the time of the merge.) Every commit has a chain of ancestors back to the first commit in the repo. Each commit is just a change on top of the state of the repo represented by its "parent" commit. [Edit to add: The whole file is never stored on disk, unless it is a brand-new file (or a "binary" file like a jpeg, where storing "just the changes" is not technically efficient.) Instead, "only the changes" are stored with each commit. That means, when you first clone a Git repo, it must reconstruct every file starting back at the first commit! That is to say, having just the most-recent commit would give you an incomplete picture of the repo. The only way to get the complete picture is to start from the beginning (the initial commit) and work through every additional commit until the end of a given "branch". At that point, a complete picture, as it appears for that branch, is formed.] About merges:A merge is designed to take one branch, and merge all its changes into a second branch. When Git merges, it first takes both branches back ("rewinds" the state of the repository back in time) to whatever commit the branches are both based on (however far back that may be).... Then, Git tries to apply the changes (aka commits) since that time from both branches simultaneously! If there are changes to one file in both branches, with different results, you have to go in and manually tell Git what to do to "resolve" the conflict. (I recommend Atom for this, if you ever run into a merge conflict and want to try to fix it. That is a text-editor made by GitHub's programmers, designed to understand and work with Git repositories. If you do use Atom, make sure to click I went a while before I felt like I could confidently resolve a merge conflict. It is a more-advanced thing, so there's no expectation of flying through advanced maneuvers right away. It will come with time, I expect. Something slightly easier might be to rebase, instead of merge. (Whichever generates the fewest merge conflicts is what I'd call easiest.) About rebaseRebase is like a merge, in that it rewinds your repo back in time to an earlier state, then "replays" your commits. Rebase is simpler than a regular merge, though. First,
You can still run into merge conflicts, though. This is just designed to be a slightly more simple way to "replay" commits compared to a regular merge. Even simpler than this would be "cherry-picking" About cherry-pickCherry-pick is a tiny little self-contained
(Note: the new, cherry-picked version of the commit gets a new commit ID, which makes it unique from the original commit. This can cause a hassle (merge conflicts) if both versions of the commit are merged into the same branch. One you learn how to resolve merge conflicts, this becomes "not a big deal.") not-so-fun-fact: Even just cherry-picking one commit can cause a merge conflict! The changes in the original commit may conflict with changes you've made since your branch's and the original commit's most-recent-common-ancestor. The only way that guarantees no merge conflicts:The only way to avoid merge conflicts is to not rebase, cherry-pick, or merge. (This sounds like what you did in the To do so, just copy the files that you worked on in one branch somewhere else for safe keeping... preferably outside of any Git repository or Git folder. Then get on a branch matching upstream Strategies for a long-term workflow
The sort of "industry best practice" most people agree on is:
You can optionally do some other things, if you feel like it:
And in general, frequently branching off locally and trying merges can be helpful. If you do all the crazy merge experiments in a separate branch, you can keep your work safe in other branches. If anything goes wrong with the experimental branch you can just delete it. |
Thank you to all that are working on this project. <3 <3 |
OK - am going to read carefully through all of this and do the work on it tomorrow! Thanks so much @DeeDeeG ! |
OK, maybe in a rush to try things out today when I have time I accidentally closed this so have started a new PR as referenced earlier 🤦♀️ 👍 EDIT: It closed when I pushed a clean develop branch into the remote develop. |
Great work @Intimaria 👍 This will make it easier to add a further translation in different language. Working on your efforts I would like to add the translation of the Hindi language. @DeeDeeG Will that be ok? Should I raise an Issue first in refugerestrooms ? Cheers, |
Hi @ashishwadekar, thank you! It's really thanks to @DeeDeeG and others that the files are now fully translatable! Check out #421 as well as this PR for a fuller understanding of the process. Considering what friends in the LGTBQI community in India tell me (been following the conversations around Section 377, as well as discrimination towards Hijra community), I believe that it would be a great really helpful have a Hindi translation. |
Yes, we would be very interested in a Hindi translation! You can file an issue if you want, just to make it more clear that you are working on this. But mainly, having your translation in a Pull Request would be the most important thing. All the maintainers/ contributors who can help out will take a look at it as soon as they get the chance. (We are all volunteers, by the way, but we've been doing a pretty good job of responding quickly to questions and concerns as of late.) The part that may take the longest before your translations are merged in is getting another person who reads Hindi to review and give feedback on the translations. (Or if someone can review the translations quickly it might be the fastest part of the process, I suppose...) But really, I think we would be glad to have that translation, so thank you very much for asking about it, and we give full support. [Edit to add: If your run into any problems, or if you have any questions about the process, let us know and we will try to help you out.] (I speak for myself, in that I know I'd be glad to have this translation. We do have two other active, core maintainers, and I don't see why they would be anything other than super excited about this. But If there are any concerns/comments, open to further discussion, @tkwidmer, @mi-wood.) |
Hi @Intimaria & @DeeDeeG Thanks for your warm response. I will start by adding an issue for more clarity.
@Intimaria It will be a pleasure to help out the LGTBQ community in India in some way via this effort 😇 Also, I will start by forking @Intimaria s Spanish branch till the time is it being reviewed and merged in develop branch. I hope that should be a good starting point? @DeeDeeG I have been going through the PR comments, You have explained many things in detail. Reading them will impart a lot of knowledge to me. Thanks for all the explanations & teaching. 🙌 Regarding the process of review and time that may be required, I am more than happy to wait. It great to see volunteers putting in their efforts apart from their daily schedule. Thanks to all the past & present core maintainers for their time. Will be starting off with translation soon. Cheers, |
Context
Summary of Changes