diff --git a/assets/css/new-challenge.css b/assets/css/new-challenge.css index ba1c5235..9b50ac3a 100644 --- a/assets/css/new-challenge.css +++ b/assets/css/new-challenge.css @@ -177,6 +177,11 @@ gre7-border.border-box code { /* CODE STYLES -------------------------------------------------------------------------- */ + /* TODO needs some Cleanup, to have similar styling accros challenges and no doubled classes here! */ + +div.code { + padding-bottom: 4px; +} code { font-size: 0.8em; diff --git a/config/i18next.config.js b/config/i18next.config.js index c4466c87..3315eecf 100644 --- a/config/i18next.config.js +++ b/config/i18next.config.js @@ -1,18 +1,22 @@ /** Configuration Settings for i18next */ -// Available appLanguages +/* Available appLanguages + * Each language is defined as an object per languageKey: + * The Object MUST contain a name-property, which will be shown in the dropdown-menu + * Optional Property "direction: 'rtl'" is used to mark right-to-left lanugages. + */ const appLanguages = { - 'en-US': 'English', - 'de-DE': 'Deutsch', - 'es-ES': 'Español', - 'fr-FR': 'Français', - 'ja-JP': '日本語', - 'ko-KR': '한국어', - 'ku': 'کوردی', - 'pl-PL': 'Polski', - 'pt-BR': 'Português Brasileiro', - 'uk-UA': 'Українська', - 'zh-TW': '中文(臺灣)', + 'en-US': { name: 'English' }, + 'de-DE': { name: 'Deutsch' }, + 'es-ES': { name: 'Español' }, + 'fr-FR': { name: 'Français' }, + 'ja-JP': { name: '日本語' }, + 'ko-KR': { name: '한국어' }, + 'ku': { name: 'کوردی', direction: 'rtl' }, + 'pl-PL': { name: 'Polski' }, + 'pt-BR': { name: 'Português Brasileiro' }, + 'uk-UA': { name: 'Українська' }, + 'zh-TW': { name: '中文(臺灣)' }, } const appLanguageKeys = Object.keys(appLanguages) diff --git a/lib/build/build-helpers.js b/lib/build/build-helpers.js index a9e76089..65c823d6 100644 --- a/lib/build/build-helpers.js +++ b/lib/build/build-helpers.js @@ -11,8 +11,8 @@ function getLocaleMenu () { const { appLanguages } = require('../../config/i18next.config') let localeMenu = '' - Object.entries(appLanguages).forEach(([languageKey, language]) => { - localeMenu = localeMenu.concat('') + Object.entries(appLanguages).forEach(([languageKey, languageObject]) => { + localeMenu = localeMenu.concat('') }) return localeMenu } diff --git a/lib/i18n-translate.js b/lib/i18n-translate.js index 73329e86..b3eb0931 100644 --- a/lib/i18n-translate.js +++ b/lib/i18n-translate.js @@ -8,6 +8,7 @@ */ const i18n = require('electron').remote.getGlobal('i18n') +const { appLanguages } = require('../config/i18next.config') // defaultOptions for interpolation const defaultOptions = { @@ -99,9 +100,18 @@ function insertBoxTranslationStyles () { document.styleSheets[sheetIndex].deleteRule(0) } - // Append new rules - document.styleSheets[sheetIndex].insertRule(".chal-goal.border-box::before {content: '" + i18n.t('Goal') + "';}", 0) - document.styleSheets[sheetIndex].insertRule(".chal-no-pass.border-box::before {content: '" + i18n.t("Didn't Pass?") + "';}", 0) - document.styleSheets[sheetIndex].insertRule(".chal-tip.border-box::before {content: '" + i18n.t('Tip') + "';}", 0) - document.styleSheets[sheetIndex].insertRule(".chal-step.border-box::before {content: '" + i18n.t('Step') + "';}", 0) + // Insert Style for right-to-left languages + if (appLanguages[i18n.language].direction === 'rtl') { + document.styleSheets[sheetIndex].insertRule('div.content {direction: rtl;}') + // Code-Elements should stay ltr + document.styleSheets[sheetIndex].insertRule('div.code {direction: ltr;}') + } + + // Append rules for challenge-boxes + if (document.styleSheets[sheetIndex].ownerNode.id === 'challenge-translation-style') { + document.styleSheets[sheetIndex].insertRule(".chal-goal.border-box::before {content: '" + i18n.t('Goal') + "';}") + document.styleSheets[sheetIndex].insertRule(".chal-no-pass.border-box::before {content: '" + i18n.t("Didn't Pass?") + "';}") + document.styleSheets[sheetIndex].insertRule(".chal-tip.border-box::before {content: '" + i18n.t('Tip') + "';}") + document.styleSheets[sheetIndex].insertRule(".chal-step.border-box::before {content: '" + i18n.t('Step') + "';}") + } } diff --git a/resources/content/challenges/11_merge_tada.hbs b/resources/content/challenges/11_merge_tada.hbs index d613d27b..07032382 100644 --- a/resources/content/challenges/11_merge_tada.hbs +++ b/resources/content/challenges/11_merge_tada.hbs @@ -13,16 +13,16 @@
-git checkout gh-pages
git checkout gh-pagesgit merge <BRANCHNAME>
git merge <BRANCHNAME>git branch -d <BRANCHNAME>
git branch -d <BRANCHNAME>git push <REMOTENAME> --delete <BRANCHNAME>
git push <REMOTENAME> --delete <BRANCHNAME>git pull upstream gh-pages
git pull upstream gh-pagesgit merge <BRANCHNAME>
+ git merge <BRANCHNAME>git checkout <BRANCHNAME>
+ git checkout <BRANCHNAME>git branch -d <BRANCHNAME>
+ git branch -d <BRANCHNAME>git push <REMOTENAME> --delete <BRANCHNAME>
+ git push <REMOTENAME> --delete <BRANCHNAME>git pull <REMOTENAME> <BRANCHNAME>
+ git pull <REMOTENAME> <BRANCHNAME>git --version
git --versiongit version 1.9.1
git version 1.9.1git config --global user.name "Your Name"
git config --global user.name "Your Name"git config --global user.email "youremail@example.com"
git config --global user.email "youremail@example.com"-
mkdir hello-world
+ mkdir hello-world-
cd hello-world
+ cd hello-worldgit init
+ git initmkdir <FOLDERNAME>
+ mkdir <FOLDERNAME>cd <FOLDERNAME>
+ cd <FOLDERNAME>ls
+ ls git init
+ git initgit status
git statusgit add readme.txt
git add readme.txtgit commit -m "Created readme"
git commit -m "Created readme"git diff
git diffgit statusgit statusgit diffgit diffgit add <FILENAME>git add <FILENAME>git add .git add .git commit -m "your commit message"git commit -m "your commit message"git config --global user.username <UserName>
+ git config --global user.username <UserName>git config --global user.username
+ git config --global user.usernamegit config --global user.username <UserName>
git config --global user.username <UserName>git remote add origin <URLFROMGITHUB>
+ git remote add origin <URLFROMGITHUB>git remote set-url origin <URLFROMGITHUB>
+ git remote set-url origin <URLFROMGITHUB>git push origin master
+ git push origin mastergit remote add <REMOTENAME> <URL>
+ git remote add <REMOTENAME> <URL>git remote set-url <REMOTENAME> <URL>
+ git remote set-url <REMOTENAME> <URL>git pull <REMOTENAME> <BRANCHNAME>
+ git pull <REMOTENAME> <BRANCHNAME>git remote -v
+ git remote -vgit push <REMOTENAME> <BRANCH>
+ git push <REMOTENAME> <BRANCH>-
cd ..
cd ..git clone <URLFROMGITHUB>
git clone <URLFROMGITHUB>cd patchwork
cd patchworkgit remote add upstream https://github.com/jlord/patchwork.git
git remote add upstream https://github.com/jlord/patchwork.gitgit remote add <REMOTENAME> <URL>git remote add <REMOTENAME> <URL>git remote set-url <REMOTENAME> <URL>git remote set-url <REMOTENAME> <URL>git remote -vgit remote -vhttp://githubusername.github.io/repositoryname
+ http://githubusername.github.io/repositorynamegit branch <BRANCHNAME>
git branch <BRANCHNAME>git checkout <BRANCHNAME>
git checkout <BRANCHNAME>git status
git add <contributors/FILENAME>
git commit -m "commit message"
git statusgit add <contributors/FILENAME>git commit -m "commit message"git push origin <BRANCHNAME>
git push origin <BRANCHNAME>git add -A
git commit -m "move file into contributors folder"
git add -Agit commit -m "move file into contributors folder"git branch -m <NEWBRANCHNAME>
git branch -m <NEWBRANCHNAME>git checkout -b <BRANCHNAME>git checkout -b <BRANCHNAME>git branch <BRANCHNAME>git branch <BRANCHNAME>git checkout <BRANCHNAME>git checkout <BRANCHNAME>git branchgit branchgit branch -m <NEWBRANCHNAME>git branch -m <NEWBRANCHNAME>git statusgit statushttps://github.com/YOURUSERNAME/patchwork/settings/access
+ https://github.com/YOURUSERNAME/patchwork/settings/accessgit pull <REMOTENAME> <BRANCHNAME>
git pull <REMOTENAME> <BRANCHNAME>git status
+ git statusgit pull <REMOTENAME> <REMOTEBRANCH>
+ git pull <REMOTENAME> <REMOTEBRANCH>git fetch --dry-run
+ git fetch --dry-runmkdir <FOLDERNAME>
+ mkdir <FOLDERNAME>cd <FOLDERNAME>
+ cd <FOLDERNAME>ls
+ ls git --version
+ git --versiongit config --global user.name "Your Name"
+ git config --global user.name "Your Name"git config --global user.email youremail@example.com
+ git config --global user.email youremail@example.comgit config --global user.username uSeRnAmE
+ git config --global user.username uSeRnAmEgit init
+ git initgit status
+ git statusgit diff
+ git diffgit add <FILENAME>
+ git add <FILENAME>git add .
+ git add .git commit -m "your commit message"
+ git commit -m "your commit message"git clone <URL>
+ git clone <URL>git branch <BRANCHNAME>
+ git branch <BRANCHNAME>git checkout <BRANCHNAME>
+ git checkout <BRANCHNAME>git checkout -b <BRANCHNAME>
+ git checkout -b <BRANCHNAME>git branch
+ git branchgit branch -m <NEWBRANCHNAME>
+ git branch -m <NEWBRANCHNAME>git remote add <REMOTENAME> <URL>
+ git remote add <REMOTENAME> <URL>git remote set-url <REMOTENAME> <URL>
+ git remote set-url <REMOTENAME> <URL>git remote -v
+ git remote -vgit pull
+ git pullgit pull <REMOTENAME> <REMOTEBRANCH>
+ git pull <REMOTENAME> <REMOTEBRANCH>git fetch --dry-run
+ git fetch --dry-rungit push <REMOTENAME> <BRANCHNAME>
+ git push <REMOTENAME> <BRANCHNAME>git merge <BRANCHNAME>
+ git merge <BRANCHNAME>git branch -D <BRANCHNAME>
+ git branch -D <BRANCHNAME>git push <REMOTENAME> --delete <BRANCHNAME>
+ git push <REMOTENAME> --delete <BRANCHNAME>