Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Feature/#190 i18n #293

Closed
wants to merge 6 commits into from
Closed

Feature/#190 i18n #293

wants to merge 6 commits into from

Conversation

Unrated
Copy link
Contributor

@Unrated Unrated commented Sep 16, 2022

shop items are not translated

@Unrated Unrated requested a review from verdie-g September 16, 2022 19:43
@verdie-g
Copy link
Owner

Awesome 👌 I'll take some time to read about vue-i18n before rewiewing

@Unrated
Copy link
Contributor Author

Unrated commented Sep 17, 2022

added shop i18n. its mostly translated by google translator with some adjustments i made. we should get some people to start checking the translations and maybe bring some more in,

blue category weapon types are not translated yet. also there is a bug with these 1H and 2H since they are for some weapons duplicated.

grafik

@Unrated Unrated added the area/web-ui Web UI features related label Sep 18, 2022
". It adds persistence to the multiplayer. You start as a peasant and you'll develop your unique character with different stats and items.",
homeSignIn: 'Sign in through Steam',
homeFAQTitle: 'F.A.Q',
homeQuestion1: 'Is the mod available?',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case you can use an array

homeFAQList: [
 [
   'Is the mod available?', 
   'The mod is currently in beta..'
 ],
]

or

homeFAQList: [
 {
   answer: 'Is the mod available?', 
   question: 'The mod is currently in beta..'
 },
]

itemPropertiesHandling: 'Handling',

// Items
crpg_female_head_wrap: 'Female Headwrap',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, we should't create a mapping id <=> $t('name').
It is necessary to implement the response from the REST API in the selected (current) language.

Commonly used req/res header Accept-Language @verdie-g

Front-end should't know about the items.

@@ -24,7 +24,7 @@
</figure>
</div>
<div class="card-content content">
<h4>{{ item.name }}</h4>
<h4>{{ $t(item.id) }}</h4>
Copy link
Collaborator

@or2e or2e Oct 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See

}
],
"Providers": {
"Steam": { "ApplicationKey": "FE0A32B959ED3C6561E1F3F3BE68F75D" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discarding pls, just add to git stash

@@ -6,5 +6,6 @@
"tabWidth": 2,
"htmlWhitespaceSensitivity": "ignore",
"arrowParens": "avoid",
"trailingComma": "es5"
"trailingComma": "es5",
"endOfLine": "auto"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if you need to change the default value (lf)

@@ -17,7 +18,7 @@ async function trySend(method: string, path: string, body?: any): Promise<Result
});

if (response.status === 401) {
notify('Session expired', NotificationType.Warning);
notify(i18n.t('sessionExpired').toString(), NotificationType.Warning);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose to cheat a little so as not to write .toString() everywhere
reference

@@ -9,7 +9,11 @@ import '@fortawesome/fontawesome-free/css/all.css';
import '@fortawesome/fontawesome-free/css/fontawesome.css';
import 'leaflet/dist/leaflet.css';
import '@/assets/scss/index.scss';
import VueI18n from 'vue-i18n';
import en from '@/resources/i18n/i18n_en';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use lazy loading

router,
store,
render: h => h(App),
}).$mount('#app');

export { i18n };
Copy link
Collaborator

@or2e or2e Oct 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entry point to the application should't return anything.
It is better to create a boot/i18n.ts or setup/i18n.ts
ref

@@ -0,0 +1,6 @@
export function mapFilter<K extends keyof any, T>(m: Map<K, T>, f: (value: K) => boolean) {
Copy link
Collaborator

@or2e or2e Oct 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use a clean function and return the new Map
ref

@@ -0,0 +1,1363 @@
/* eslint-disable @typescript-eslint/naming-convention */
const en = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe YAML )

@or2e or2e self-assigned this Oct 3, 2022
@verdie-g verdie-g force-pushed the master branch 2 times, most recently from c006ecc to 16b9370 Compare October 8, 2022 13:45
@verdie-g
Copy link
Owner

Let's do i18n in the new UI instead.

@verdie-g verdie-g closed this Nov 21, 2022
@verdie-g verdie-g deleted the feature/#190-i18n branch December 27, 2022 13:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/web-ui Web UI features related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants