feat: translate skills

This commit is contained in:
Adrien Marquès 2022-10-12 10:47:42 +02:00
parent 6f292a02e9
commit 965574d112
Signed by: xdrm-brackets
GPG Key ID: D75243CA236D825E
5 changed files with 130 additions and 22 deletions

View File

@ -9,7 +9,7 @@
<script lang="ts"> <script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'; import { Component, Prop, Vue } from 'vue-property-decorator';
import { tID } from '@/model/skills'; import { skillLabel, tID } from '@/model/skills';
import * as skills from '@/service/skills'; import * as skills from '@/service/skills';
@Component({}) @Component({})
@ -59,7 +59,7 @@ export default class SkillCard extends Vue {
if ( skill == null ) { if ( skill == null ) {
return ''; return '';
} }
return skill.name; return this.$t(skillLabel(this.id)).toString();
} }
private onClick(e: MouseEvent) { private onClick(e: MouseEvent) {

View File

@ -49,7 +49,7 @@
<script lang="ts"> <script lang="ts">
import { Component, Vue } from 'vue-property-decorator'; import { Component, Vue } from 'vue-property-decorator';
import SkillCard from './SkillCard.vue'; import SkillCard from './SkillCard.vue';
import { tID, tTag } from '@/model/skills'; import { skillLabel, tagLabel, tID, tTag } from '@/model/skills';
import { Project } from '@/model/projects'; import { Project } from '@/model/projects';
import * as skills from '@/service/skills'; import * as skills from '@/service/skills';
import * as projects from '@/service/projects'; import * as projects from '@/service/projects';
@ -88,20 +88,7 @@ export default class SkillPicker extends Vue {
// returns the label for a tag // returns the label for a tag
protected tagLabel(t: tTag): string { protected tagLabel(t: tTag): string {
switch(t){ return tagLabel(t);
case tTag.All: return 'tag.all';
case tTag.Web: return 'tag.web';
case tTag.Storage: return 'tag.storage';
case tTag.UI: return 'tag.ui';
case tTag.System: return 'tag.system';
case tTag.Mobile: return 'tag.mobile';
case tTag.Network: return 'tag.network';
case tTag.IoT: return 'tag.iot';
case tTag.Organization: return 'tag.organization';
case tTag.Language: return 'tag.language';
case tTag.Human: return 'tag.human';
case tTag.Other: return 'tag.other';
}
} }
// selects or deselects a skill. If the skill is not in the current // selects or deselects a skill. If the skill is not in the current

View File

@ -26,5 +26,51 @@
"tag.human": "Human", "tag.human": "Human",
"tag.other": "Other", "tag.other": "Other",
"skill.mariadb": "MariaDB",
"skill.postgres": "PostgreSQL",
"skill.mongo": "MongoDB",
"skill.vue": "Vue <i>(.js)</i>",
"skill.angular": "Angular <i>(7+)</i>",
"skill.parcel": "Parcel",
"skill.cordova": "Apache Cordova",
"skill.webpack": "Webpack",
"skill.webgl": "WebGL",
"skill.audioapi": "Audio API",
"skill.websocket": "Websocket",
"skill.docker": "Docker",
"skill.bash": "bash",
"skill.linux": "GNU/Linux",
"skill.systemd": "systemd",
"skill.git": "Git",
"skill.rpm": "RPM packaging",
"skill.raspberry": "Raspberry",
"skill.arduino": "Arduino",
"skill.php": "PHP",
"skill.html": "HTML5",
"skill.css": "CSS3",
"skill.js": "Javascript",
"skill.ajax": "AJAX",
"skill.ts": "Typescript",
"skill.c": "C (lang)",
"skill.cpp": "C++",
"skill.python": "Python",
"skill.go": "Go (lang)",
"skill.qt": "Qt",
"skill.opensource": "Open-source",
"skill.electronics": "Electronics",
"skill.web": "Web",
"skill.rest": "REST",
"skill.crypto": "Security/crypto",
"skill.imageprocessing": "Image processing",
"skill.ai": "Artificial Intelligence",
"skill.deeplearning": "Deep Learning",
"skill.neuralnetwork": "Neural Networks",
"skill.opti": "Program optimization",
"skill.sockets": "Sockets",
"skill.concurrency": "Concurrency",
"skill.uiux": "UI/UX",
"skill.inkscape": "Inkscape",
"skill.rnd": "R&D",
"end": "" "end": ""
} }

View File

@ -25,5 +25,13 @@
"tag.human": "Humain", "tag.human": "Humain",
"tag.other": "Autre", "tag.other": "Autre",
"skill.electronics": "Electronique",
"skill.crypto": "Securité/crypto",
"skill.imageprocessing": "Traitement d'image",
"skill.ai": "Intelligence Artificielle",
"skill.neuralnetwork": "Réseaux de neuronnes",
"skill.opti": "Optimization",
"skill.concurrency": "Programmation Concurrente",
"end": "" "end": ""
} }

View File

@ -61,6 +61,73 @@ export enum tTag {
Other Other
} }
export function tagLabel(t: tTag): string {
switch(t){
case tTag.All: return 'tag.all';
case tTag.Web: return 'tag.web';
case tTag.Storage: return 'tag.storage';
case tTag.UI: return 'tag.ui';
case tTag.System: return 'tag.system';
case tTag.Mobile: return 'tag.mobile';
case tTag.Network: return 'tag.network';
case tTag.IoT: return 'tag.iot';
case tTag.Organization: return 'tag.organization';
case tTag.Language: return 'tag.language';
case tTag.Human: return 'tag.human';
case tTag.Other: return 'tag.other';
}
}
export function skillLabel(s: tID): string {
switch(s){
case tID.MariaDB: return 'skill.mariadb';
case tID.Postgres: return 'skill.postgres';
case tID.Mongo: return 'skill.mongo';
case tID.Vue: return 'skill.vue';
case tID.Angular: return 'skill.angular';
case tID.Parcel: return 'skill.parcel';
case tID.Cordova: return 'skill.cordova';
case tID.Webpack: return 'skill.webpack';
case tID.WebGL: return 'skill.webgl';
case tID.AudioAPI: return 'skill.audioapi';
case tID.Websocket: return 'skill.websocket';
case tID.Docker: return 'skill.docker';
case tID.Bash: return 'skill.bash';
case tID.Linux: return 'skill.linux';
case tID.Systemd: return 'skill.systemd';
case tID.Git: return 'skill.git';
case tID.Rpm: return 'skill.rpm';
case tID.RaspBerry: return 'skill.raspberry';
case tID.Arduino: return 'skill.arduino';
case tID.Php: return 'skill.php';
case tID.Html: return 'skill.html';
case tID.Css: return 'skill.css';
case tID.Js: return 'skill.js';
case tID.Ajax: return 'skill.ajax';
case tID.Ts: return 'skill.ts';
case tID.C: return 'skill.c';
case tID.Cpp: return 'skill.cpp';
case tID.Python: return 'skill.python';
case tID.Go: return 'skill.go';
case tID.Qt: return 'skill.qt';
case tID.OpenSource: return 'skill.opensource';
case tID.Electronics: return 'skill.electronics';
case tID.Web: return 'skill.web';
case tID.Rest: return 'skill.rest';
case tID.Crypto: return 'skill.crypto';
case tID.ImageProcessing: return 'skill.imageprocessing';
case tID.AI: return 'skill.ai';
case tID.DeepLearning: return 'skill.deeplearning';
case tID.NeuralNetwork: return 'skill.neuralnetwork';
case tID.Opti: return 'skill.opti';
case tID.Sockets: return 'skill.sockets';
case tID.Concurrency: return 'skill.concurrency';
case tID.UIUX: return 'skill.uiux';
case tID.Inkscape: return 'skill.inkscape';
case tID.RnD: return 'skill.rnd';
}
}
export interface tSkill { export interface tSkill {
icon: string|null; icon: string|null;
name: string; name: string;
@ -300,7 +367,7 @@ export const Skills: tSkills = {
name: 'Electronics', name: 'Electronics',
link: 'https://en.wikipedia.org/wiki/Electronics', link: 'https://en.wikipedia.org/wiki/Electronics',
icon: 'skills/electronics.svg', icon: 'skills/electronics.svg',
tags: [tTag.Organization, tTag.IoT], tags: [tTag.Other, tTag.IoT],
info: '', info: '',
}, },
[tID.Web]: { [tID.Web]: {
@ -335,21 +402,21 @@ export const Skills: tSkills = {
name: 'Artificial Intelligence', name: 'Artificial Intelligence',
link: 'https://en.wikipedia.org/wiki/Artificial_intelligence', link: 'https://en.wikipedia.org/wiki/Artificial_intelligence',
icon: null, icon: null,
tags: [tTag.Organization], tags: [tTag.Other],
info: '', info: '',
}, },
[tID.DeepLearning]: { [tID.DeepLearning]: {
name: 'Deep Learning', name: 'Deep Learning',
link: 'https://en.wikipedia.org/wiki/Deep_learning', link: 'https://en.wikipedia.org/wiki/Deep_learning',
icon: null, icon: null,
tags: [tTag.Organization], tags: [tTag.Other],
info: '', info: '',
}, },
[tID.NeuralNetwork]: { [tID.NeuralNetwork]: {
name: 'Neural Networks', name: 'Neural Networks',
link: 'https://en.wikipedia.org/wiki/Artificial_neural_network', link: 'https://en.wikipedia.org/wiki/Artificial_neural_network',
icon: null, icon: null,
tags: [tTag.Organization], tags: [tTag.Other],
info: '', info: '',
}, },
[tID.Opti]: { [tID.Opti]: {
@ -391,7 +458,7 @@ export const Skills: tSkills = {
name: 'R&D', name: 'R&D',
link: 'https://en.wikipedia.org/wiki/R&D', link: 'https://en.wikipedia.org/wiki/R&D',
icon: null, icon: null,
tags: [tTag.Organization], tags: [tTag.Organization, tTag.Other],
info: '', info: '',
}, },
}; };