Comments (8)
I'd totally be willing to add i18n support -- almost all the dialogs and text use string lookup so it wouldn't be impossible. The translations might have to be sourced by the community though
Glad you like the app!!
from learngitbranching.
umm, just have a look on the code. Most dialogs are under src/level
and some error messages in src/js
, right? Can you show me how to implement the i18n support? (I mean where to store the translated message, how to use the lookup
function.) Maybe I can translate it into Chinese sometimes later.
from learngitbranching.
There's two main types of text around the site -- dialogs within some level or sandbox and small things like button names and headers.
The button names might be hard to change because they are part of the HTML template -- we would need to tokenize all their locations and then pass in the translated strings. It would be somewhat laborious but not horrible
The dialogs, however, could be fairly easy to translate. All the dialogs are located in either src/levels/<level type>/<level name>.js
or src/js/dialogs/<dialog>.js
Right now they are simply a part of a JSON structure, like
{
levelName: "rebasing",
solution: "git commit",
startDialog: [{
type: 'ModalAlert',
options: {
markdown: "Hello!!!"
}
}]
}
To add i18n support, we just make this structure one level deeper:
{
levelName: "rebasing",
solution: "git commit",
startDialog: {
english: [{
type: 'ModalAlert',
options: {
markdown: "Hello!!!"
}
}],
spanish: [{
// same
markdown: "Hola!"
]}
}
}
Obviously we would use locale codes instead of spanish
but you get the drift.
Then you just change all the caller locations and drop in new translations!
from learngitbranching.
What does the same
in spanish
mean? Does it also need type
and options
attributes?
OK, I will translate the dialogs first. Thanks for your help :)
from learngitbranching.
Yeah // same
just means it will have the same exact structure except for the actual content. I was tired of typing JSON by hand but maybe I should have carried it out.
Awesome! Really cool to have a translator on board, that's a really cool step the project can take. Let me know when you're halfway-ish done with translating a few (ping me at [email protected] ) and I'll begin the intl support
from learngitbranching.
Should I also ping you via email if I translate to another language?
from learngitbranching.
@outsideris Sure! Once any given translation gets near completion I'll race to add the i18n support. After the first one or two though, I can just manage the discussion on github. Having an email ping was simply to help prioritize issues / features
from learngitbranching.
@pcottle Thanks....
from learngitbranching.
Related Issues (20)
- Remove branches already concluded (i.e. merged/closed)? HOT 1
- link to a particular lesson HOT 3
- fakeTeamwork command for creating a branch and adding commits is not working! HOT 2
- In git-branch, the name <bugFix> is not allowed
- no support for `git merge A B` HOT 2
- Ban checkout and use "modern" commands switch/restore HOT 3
- Add Turkish (tr_TR) Translations 🇹🇷 HOT 1
- [Bug] Origin IP found HOT 1
- Hi
- Add more clarification on "git branch -f" command HOT 4
- I am a new open source development and I want to create a feature in the Introduction Sequence. Where should I start? HOT 1
- o/main is not synced when doing `git pull origin main:main` HOT 4
- Rebase Introduction is incorrect (git 2.42.0) HOT 4
- level remoteAdvanced3 branch naming not in assignment but required HOT 3
- level 5: teamwork * should not be shown HOT 2
- show solution doesn't work with custom level HOT 3
- minor correction for Korean translation
- Add deep links HOT 2
- Incorrect implementation for git fetch/pull with colon ":" affecting remoteAdvance6 HOT 4
- Add direct link to each level HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learngitbranching.