Closed retostauss closed 11 months ago
Hi Reto, awesome,
what's not quite fine (nothing to worry about, just read the whole thing first) is that this time you've made a PR from your master
branch, but it's preferrable to create a "feature" branch with a name that describes what's going on, like eep-de-translation
. It's understandable: GitHub keeps the branch creation button deeper than it should (would be useful to have it here:
) and is generally not very educative about the process. Now let's see what this means for you:
When you want to suggest a new change to a repo which have forked already, you should first create a new branch – either via the UI I've linked above or inside github.dev UI: Commit changes in that branch, and do a PR from there.
As for now, since you've already made a commit in your master
branch, we may have to do some extra steps. This is connected with your quesion in the Google Group: "Now there is this fork of mine ... what happens to it? Do I need to maintain it somehow?" GitHub is not particularly helpful about that, although it's better now:
master
branch (in your fork) should "follow" the master
branch in the original repo. When some commits are added to the original master
branch, you should update yours. Luckily, these days you can do this via a button:
master
branch, the story in it may differ from the original. I'm not sure what will happen if, say, I merge your PR about the core translation, and then you try to press Sync: it may refuse saying that the histories are different, or it may still work, I just don't know. (when doing this via git, it should probably work in this case)Now, to the changes themselves:
getFailedToLoadMsg: name => "failed to load " + name,
you should translate "failed to load "
, but probably shouldn't translate name
. I have a vague idea of JavaScript name limitations (which is probably different in different browsers), for instance whether "ß" in variable names will work correctly, not to mention other languages (hieroglyphic, right-to-left writing systems), so let's keep it simpleAh, right, there's another issue: you've put the file to locales/core/extensions/...
, while it should be locales/extensions/...
. We can handle it later, but you can try it via github.dev using drag&drop in the file explorer (Ctrl + Shift + E) and then committing with a message like "fix: change translation location". Note: you have to "add" both "deletion" and "adding" the file when moving. Normally, git will then recognize the two changes as one "renaming" (moving = "renaming path"), but github.dev doesn't show that, you just "add" (stage) two changes:
https://github.com/TiddlyWiki/translations/assets/1131924/96d534a6-eff6-417c-b6a8-28d84e42df9b
Before the video above, I've moved the file .gitignore
from java/
to java/src/
and in the video, I'm adding "deleting from java/and
adding in java/src/`.
Also, I'll update the title to make it more specific ("feature: add German translation" → "feature: add German translation for ExtensionsExplorerPlugin" → "German translation for ExtensionsExplorerPlugin")
Drag and drop worked in the file explorer. And thanks for the explanations. The test of the translation was successfull.
Hi Reto, I've noticed that you haven't created a separate branch yet and added new commits into master
. Let's fix this, so that you can go on with this quest and affect not others. For now, you can only one option to safely continue updating the core translation: do it inside the translate-264
; if you now create a new branch from master
, it will have unwanted changes:
This is what you will have if you now create translate-265 branch from master:
* - * translate-264
/
* - * - * - * - * master (with changes for EEP translation)
\
* - * translate-265 – will have unwanted changes
This is what you have currently:
* - * translate-264
/
* - * - * - * - * master (with changes for EEP translation)
This is what you need:
* - * translate-264
/
* - * master
\
* - * - * translate-eep-de
so that you can then sync master:
* - * translate-264
/ \
* - * - * master
\
* - * - * translate-eep-de
and then create translate-265 correctly:
* - * translate-264
/ \
* - * - * master
\ \
\ * - * translate-265
\
* - * - * translate-eep-de
The last picture illustrates that each new PR comes from a separate branch and merging one doesn't affect others in any way.
To help you with this, I've made a couple of "bad" commits (i.e. commits to master
) in my https://github.com/YakovL/anki-manual fork:
and now I'll move them to a separate branch and share the steps:
I open the repo (their default branch is called main
, not master
, but that doesn't make any difference)
I create a new branch from master
(naming it feature-branch
; previously I wrote that the dropdown doesn't have a "new branch" button, but if you type a name that no existing branch has, there appears the "Create branch: ..." option below)
Now my feature-branch
has those commits it should have, but master
also has them, and I want to remove them. Ideally, it would be possible from github.dev as well, but I'm afraid it is not possible now. Here's how I do this: in a local command line, in some folder:
git clone https://github.com/YakovL/anki-manual
to download the repo locally;cd anki-manual
to enter the folder and further use git for this repo;git log --oneline -n 3
– I'd prefer to check history before the edit. I need to remove 2 commits, so I check the last 2+1;git reset --hard HEAD~2
to remove the last 2 commits from the branch;git log --oneline -n 3
again, but in fact reset
reported that I'm on the right commit now;git push origin main -f
– force-push the branch to remove the commits in github (for you, it will be git push origin master -f
).At this point I can see that the main
branch is back to normal:
while feature-branch
is 2 commits ahead:
If you don't have git installed, you'll probably have to do some additional steps: setting name and email (probably not in this scenario as you don't commit anything) and doing some auth on attempt to push to Github.
If this is too much for you, I have another alternative, but it will require to close all the PRs first.
Sorry for not carefully reading what you wrote ... I tried the correction to my best understanding (which is still incomplete 😥). It seems that I was able to create a new branch translate-264-2nd and revert the commits to the master.
Can you please check if it is as it should now? What about translate-264?
Oh, wow, awesome! 👏 How did you do this? Via git or Github only? I can see that now your master
branch is 1 commit behind https://github.com/TiddlyWiki/translations, so you can sync master
(via the sync button at https://github.com/retostauss/translations), and your commits from this fork are put into another branch, which is what was needed, congratulations! 🎉
Only I'd rename that branch from translate-264-2nd
into translate-eep-de
so that it's clear from its name what it contains:
Now you can create a new PR from that branch (to continue with translating EEP), and your flow will be fine! Also, after you do Sync to master
, you can create translate-265
from it to further update the core translation.
Did the revert using git CLI as you described. Rename is also done. Now I need holidays ;-).
Not sure if I did it right ...