Skip to content

Commit

Permalink
refactor: remove all array usage
Browse files Browse the repository at this point in the history
  • Loading branch information
GalvinGao committed Feb 18, 2023
1 parent b428dbb commit 18fde98
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 167 deletions.
2 changes: 1 addition & 1 deletion src/components/functional/DoYouKnow.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Vue.component('DoYouKnow', {
// }
// },
render: function (createElement) {
const quotes = i18n.t('quotes.doYouKnow')
const quotes = i18n.t('quotes.doYouKnow').split('\n')
const index = Math.floor(Math.random() * quotes.length)

return createElement(
Expand Down
4 changes: 2 additions & 2 deletions src/components/recognition/RecognitionSubmitVisualizer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
class="markdown-content my-2"
>
<li
v-for="msg in $t('report.recognition.report.partialFailedDesc')"
v-for="msg in $t('report.recognition.report.partialFailedDesc').split('\n')"
:key="msg"
v-marked
v-text="msg"
Expand Down Expand Up @@ -127,4 +127,4 @@ export default {

<style scoped>
</style>
</style>
4 changes: 2 additions & 2 deletions src/components/stats/StageSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@

<template v-else>
<div
v-for="text in $t('stage.actions.star.empty')"
v-for="text in $t('stage.actions.star.empty').split('\n')"
:key="text"
class="caption text-left justify-center grey--text"
v-text="text"
Expand Down Expand Up @@ -186,7 +186,7 @@
</template>
<template v-else>
<div
v-for="text in $t('stage.actions.history.empty')"
v-for="text in $t('stage.actions.history.empty').split('\n')"
:key="text"
class="caption text-left justify-center grey--text"
v-text="text"
Expand Down
4 changes: 2 additions & 2 deletions src/components/stats/details/StagePatternError.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
class="d-flex flex-column align-center justify-center monospace border-light mt-2"
>
<span class="heading">
{{ $t('pattern.error')[0] }}
{{ $t('pattern.error').split('\n')[0] }}
</span>
<span class="headline">
{{ $t('pattern.error')[1] }}
{{ $t('pattern.error').split('\n')[1] }}
</span>
</v-card>
</template>
Expand Down
5 changes: 4 additions & 1 deletion src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import koMessages from '@/locales/ko.json'

Vue.use(VueI18n)

export default new VueI18n({
const i18n = new VueI18n({
locale: 'zh',
fallbackLocale: 'en',
silentFallbackWarn: true,
Expand All @@ -20,3 +20,6 @@ export default new VueI18n({
ko: koMessages
}
})

window.i18n = i18n
export default i18n
49 changes: 9 additions & 40 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,7 @@
"allSucceeded": "{count} battle results successfully reported",
"partialSucceeded": "Only {count} battle results successfully reported",
"partialFailed": "{count} failed battle result reports. Please follow the troubleshooting steps below",
"partialFailedDesc": [
"Check your network connection: The upload may be failed if the network connection is poor.",
"In order to ensure that the entire site data set is not affected by external attacks, if you still cannot upload after multiple retries, your submission volume may have triggered the reporting limit. Please try again after 24 hours to upload the remaining drop reports.",
"Your IP may be shared with others, because individuals cannot be located due to the nature of IP. In this case, please try to switch your mobile network or WiFi to retry recognition, or you can retry uploading after 24 hours.",
"To prevent retransmission attacks, we will attach a timestamp to your request; if the time of your device is too far from the standard time, the upload may fail. Please try to calibrate the device time and try again."
],
"partialFailedDesc": "Check your network connection: The upload may be failed if the network connection is poor.\nIn order to ensure that the entire site data set is not affected by external attacks, if you still cannot upload after multiple retries, your submission volume may have triggered the reporting limit. Please try again after 24 hours to upload the remaining drop reports.\nYour IP may be shared with others, because individuals cannot be located due to the nature of IP. In this case, please try to switch your mobile network or WiFi to retry recognition, or you can retry uploading after 24 hours.\nTo prevent retransmission attacks, we will attach a timestamp to your request; if the time of your device is too far from the standard time, the upload may fail. Please try to calibrate the device time and try again.",
"caption": "Thanks for reporting. Your data will be revealed in the global dataset of website in 20 minutes at most because of cache."
},
"states": {
Expand All @@ -349,16 +344,8 @@
"retry": "Failed to submit. Retrying...",
"filter": "Filter",
"notices": {
"welcome": [
"Image files will be recognized **locally** using **WebAssembly** technology. We will not upload images to our server.",
"Please use screenshots taken within 36 hours that contains only 3-stars clear. Duplications will be detected and marked as *excluded*.",
"Please do not report the first-clear of a stage, and do not only report the clears where you were lucky - report all clears."
],
"confirm": [
"Click the image to enlarge it for double-checking.",
"Screenshots which passed the legibility test have already been checked for upload.",
"With consideration of dataset accuracy, you are **disallowed** to check a screenshot that failed the legibility test for upload."
]
"welcome": "Image files will be recognized **locally** using **WebAssembly** technology. We will not upload images to our server.\nPlease use screenshots taken within 36 hours that contains only 3-stars clear. Duplications will be detected and marked as *excluded*.\nPlease do not report the first-clear of a stage, and do not only report the clears where you were lucky - report all clears.",
"confirm": "Click the image to enlarge it for double-checking.\nScreenshots which passed the legibility test have already been checked for upload.\nWith consideration of dataset accuracy, you are **disallowed** to check a screenshot that failed the legibility test for upload."
},
"exceptions": {
"Fingerprint::Same": {
Expand Down Expand Up @@ -565,17 +552,11 @@
"activate": "Star",
"activated": "Starred",
"deactivate": "Click to Cancel Star",
"empty": [
"Currently you've not starred any stages",
"You can star a stage by going to its 'Quick Access' section in its details panel."
]
"empty": "Currently you've not starred any stages\nYou can star a stage by going to its 'Quick Access' section in its details panel."
},
"history": {
"name": "Recently Accessed",
"empty": [
"No recent accessed stages available",
"After you've visit any stage pages, a record will appear at here."
],
"empty": "No recent accessed stages available\nAfter you've visit any stage pages, a record will appear at here.",
"clear": "Clear"
},
"links": {
Expand Down Expand Up @@ -799,18 +780,12 @@
"required": "Required"
},
"quotes": {
"doYouKnow": [
"Do You Know? Ptilopsis' feather is sooo cute! o(*≧▽≦)ツ"
]
"doYouKnow": "Do You Know? Ptilopsis' feather is sooo cute! o(*≧▽≦)ツ"
},
"credits": {
"material": {
"title": "Content Credits",
"content": [
"Penguin Statistics utilizes (including but not limited to) pictures, animations, audio, original text and other works for the purpose of better reflecting the corresponding elements in the game and enhance the user experience. The copyright of such works belongs to the provider of the game, Shanghai Hypergryph Network Technology Co., Ltd. and/or its affiliates, including but not limited to YOSTAR (HONG KONG) LIMITED, 株式会社Yostar, YOSTAR LIMITED, 龍成網路, etc,.",
"Penguin Statistics utilizes some assets from PRTS Wiki (http://prts.wiki) and has changed some of the assets without modifying its original meaning.",
"Penguin Statistics used the slightly self-modified version of the Bender font, provided by the Free Fonts Project under a usage basis claimed on the official website of the Project ( http://jovanny.ru ) of \"All fonts from the Free Fonts Project can be used both for commercial and personal purposes without any limitations.\". Penguin Statistics hereby specially thanks and appreciates the Bender font for releasing their awesome font under such license."
]
"content": "Penguin Statistics utilizes (including but not limited to) pictures, animations, audio, original text and other works for the purpose of better reflecting the corresponding elements in the game and enhance the user experience. The copyright of such works belongs to the provider of the game, Shanghai Hypergryph Network Technology Co., Ltd. and/or its affiliates, including but not limited to YOSTAR (HONG KONG) LIMITED, 株式会社Yostar, YOSTAR LIMITED, 龍成網路, etc,.\nPenguin Statistics utilizes some assets from PRTS Wiki (http://prts.wiki) and has changed some of the assets without modifying its original meaning.\nPenguin Statistics used the slightly self-modified version of the Bender font, provided by the Free Fonts Project under a usage basis claimed on the official website of the Project ( http://jovanny.ru ) of \"All fonts from the Free Fonts Project can be used both for commercial and personal purposes without any limitations.\". Penguin Statistics hereby specially thanks and appreciates the Bender font for releasing their awesome font under such license."
},
"source": {
"title": "Open Source Licenses"
Expand Down Expand Up @@ -882,10 +857,7 @@
"pattern": {
"name": "Drop Patterns",
"empty": "(No Drops)",
"error": [
"Drop Patterns for this Stage",
"Currently not Available"
]
"error": "Drop Patterns for this Stage\nCurrently not Available"
},
"share": {
"name": "Share",
Expand Down Expand Up @@ -945,10 +917,7 @@
"nga": "NGA Thread"
},
"quickStart": "Quick Start",
"caption": [
"Click the",
"button to expand menu and see more features"
],
"caption": "Click the\nbutton to expand menu and see more features",
"subtitle": {
"report": "I wanna report drops",
"byItem": "Where should I farm rocks?",
Expand Down
39 changes: 7 additions & 32 deletions src/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,7 @@
"allSucceeded": "{count} 件の認識結果がアップロード成功",
"partialSucceeded": "{count} 件の認識結果のみアップロード成功",
"partialFailed": "{count} 件の認識結果がアップロード失敗しました。以下のチェックリストをしたがって、問題を解決してみてください。",
"partialFailedDesc": [
"● ネットワーク接続の状況を確認:接続不安定・接続中断でアップロード失敗が発生します。",
"● 大量のレポートしましたか:データベースを外部の攻撃から守るために、一日のレポート数には上限があります。何度も試してもアップロードできない場合、上限に達した可能性がありますので、24時間後に再試行してください。",
"● 共有IPアドレスを使用していますか:一部の地域には、ご使用のIPアドレスは他人と共有している可能性があります。この場合、ネット環境の切り替え(ルーター再起動、WiFi・4Gの切り替え)をしてから再試行してください。また、24時間後に再試行してください。",
"● デバイスの時刻を確認:重複レポ攻撃を防止対策として、端末からのリクエストにはタイムスタンプを付与します。ご使用のデバイスの時刻が正確な時刻と大きく異なる場合、アップロード失敗が発生しますので、デバイスの時刻を調整してください。"
],
"partialFailedDesc": "● ネットワーク接続の状況を確認:接続不安定・接続中断でアップロード失敗が発生します。\n● 大量のレポートしましたか:データベースを外部の攻撃から守るために、一日のレポート数には上限があります。何度も試してもアップロードできない場合、上限に達した可能性がありますので、24時間後に再試行してください。\n● 共有IPアドレスを使用していますか:一部の地域には、ご使用のIPアドレスは他人と共有している可能性があります。この場合、ネット環境の切り替え(ルーター再起動、WiFi・4Gの切り替え)をしてから再試行してください。また、24時間後に再試行してください。\n● デバイスの時刻を確認:重複レポ攻撃を防止対策として、端末からのリクエストにはタイムスタンプを付与します。ご使用のデバイスの時刻が正確な時刻と大きく異なる場合、アップロード失敗が発生しますので、デバイスの時刻を調整してください。",
"caption": "レポートありがとうございます。キャッシュの原因で、レポートしたデータが反映するまで、20分程度の時間がかかる可能性があります。"
},
"states": {
Expand All @@ -333,16 +328,8 @@
"retry": "送信失敗、リトライ中",
"filter": "結果フィルター",
"notices": {
"welcome": [
"ご提供の画像はWebAssembly技術でローカルにて認識しますので、認識段階でサーバーへのデーター送信はございません。",
"スクリーンショットは、作成時刻が**36 時間内**、またクリア評価が**星3**のものをご選択ください。",
"初回クリアのスクリーンショットの選択はご遠慮ください。**偏向的に**一部だけのスクリーンショット(極端にいい・悪いケース)でのレポートはご遠慮ください。"
],
"confirm": [
"画像をクリックしたら拡大できます、もう一回クリックしたら元に戻せます",
"認識成功のスクリーンショットは自動的にチェックを入れています",
"本サイトのデータの正確度のため、エラーのある画像はご選択できません"
]
"welcome": "ご提供の画像はWebAssembly技術でローカルにて認識しますので、認識段階でサーバーへのデーター送信はございません。\nスクリーンショットは、作成時刻が**36 時間内**、またクリア評価が**星3**のものをご選択ください。\n初回クリアのスクリーンショットの選択はご遠慮ください。**偏向的に**一部だけのスクリーンショット(極端にいい・悪いケース)でのレポートはご遠慮ください。",
"confirm": "画像をクリックしたら拡大できます、もう一回クリックしたら元に戻せます\n認識成功のスクリーンショットは自動的にチェックを入れています\n本サイトのデータの正確度のため、エラーのある画像はご選択できません"
},
"exceptions": {
"Fingerprint::Same": {
Expand Down Expand Up @@ -513,17 +500,11 @@
"activate": "作戦にスターを追加",
"activated": "作戦にスターを追加しました",
"deactivate": "クリックしてスターを削除",
"empty": [
"スター付き作戦はありません",
"作戦情報の「クイック操作」で作戦にスターを追加するとここに表示されます"
]
"empty": "スター付き作戦はありません\n作戦情報の「クイック操作」で作戦にスターを追加するとここに表示されます"
},
"history": {
"name": "最近選択した作戦",
"empty": [
"最近選択した作戦はありません",
"作戦のページをアクセスするとここに表示されます"
],
"empty": "最近選択した作戦はありません\n作戦のページをアクセスするとここに表示されます",
"clear": "クリア"
},
"links": {
Expand Down Expand Up @@ -701,10 +682,7 @@
"pattern": {
"name": "ドロップパターン",
"empty": "ドロップなし",
"error": [
"本作戦のドロップパターンの",
"データはありません"
]
"error": "本作戦のドロップパターンの\nデータはありません"
},
"share": {
"name": "共有",
Expand Down Expand Up @@ -769,10 +747,7 @@
"nga": "NGA スレッド"
},
"quickStart": "クイックスタート",
"caption": [
"左上の",
"ボタンをクリックしてメニューを展開すると、さらに多くの機能が表示されます。"
],
"caption": "左上の\nボタンをクリックしてメニューを展開すると、さらに多くの機能が表示されます。",
"subtitle": {
"report": "ドロップを報告したい",
"byItem": "岩ってどこ回ったらいいのかな",
Expand Down
Loading

0 comments on commit 18fde98

Please sign in to comment.