Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Nuxt i18n Experience Sharing
Search
LINE Developers Taiwan
PRO
August 19, 2020
Programming
0
13k
Nuxt i18n Experience Sharing
Nuxt i18n 實戰經驗分享 @ v-tw #006
v-tw event:
https://vuejs.kktix.cc/events/v-tw-meetup-006
LINE Developers Taiwan
PRO
August 19, 2020
Tweet
Share
More Decks by LINE Developers Taiwan
See All by LINE Developers Taiwan
菸酒生在 LINE Taiwan 的後端雙刀流
line_developers_tw
PRO
0
1.2k
讓測試不再 BB! 從 BDD 到 CI/CD, 不靠人力也能 MVP
line_developers_tw
PRO
0
1.3k
DB 醬,嗨!哪泥嘎斯基?
line_developers_tw
PRO
0
1.3k
比起獨自升級 我更喜歡 DevOps 文化 <3
line_developers_tw
PRO
0
1.3k
工具人的一生: 開發很多 AI 工具讓我 慵懶過一生
line_developers_tw
PRO
0
1.3k
從四件事帶你見識見識 事件驅動架構設計 (EDA)
line_developers_tw
PRO
0
1.2k
TODAY 看世界(?) 是我們在看扣啦!
line_developers_tw
PRO
0
1.3k
你想成為什麼樣的開發者?
line_developers_tw
PRO
0
26
研究生的 LINER生活
line_developers_tw
PRO
0
28
Other Decks in Programming
See All in Programming
CDK引数設計道場100本ノック
badmintoncryer
2
420
Deep Dive into ~/.claude/projects
hiragram
14
12k
ご注文の差分はこちらですか? 〜 AWS CDK のいろいろな差分検出と安全なデプロイ
konokenj
3
530
AIともっと楽するE2Eテスト
myohei
8
2.9k
MDN Web Docs に日本語翻訳でコントリビュートしたくなる
ohmori_yusuke
1
130
AIエージェントはこう育てる - GitHub Copilot Agentとチームの共進化サイクル
koboriakira
0
680
Flutterで備える!Accessibility Nutrition Labels完全ガイド
yuukiw00w
0
170
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
310
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
570
脱Riverpod?fqueryで考える、TanStack Queryライクなアーキテクチャの可能性
ostk0069
0
350
The Niche of CDK Grant オブジェクトって何者?/the-niche-of-cdk-what-isgrant-object
hassaku63
1
560
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
910
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Testing 201, or: Great Expectations
jmmastey
43
7.6k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
830
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
Raft: Consensus for Rubyists
vanstee
140
7k
Faster Mobile Websites
deanohume
307
31k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Practical Orchestrator
shlominoach
189
11k
Code Reviewing Like a Champion
maltzj
524
40k
Producing Creativity
orderedlist
PRO
346
40k
Bash Introduction
62gerente
613
210k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Transcript
Abel — LINE TODAY 前端工程師 2020.08.19 1X[W LQ 䋿䜗妿涢獤Ձ
Menu 1. Intro Nuxt i18n 5mins 2. Intro LINE TODAY
5mins 3. Our Problems 15mins 4. Q&A 5mins
Nuxt i18n Example
Nuxt i18n Set Locale
Nuxt i18n Lazy Load
LINE TODAY 4 Countries 2500 Messages 4 Languages
LINE TODAY Modules
LINE TODAY Async Component
Nuxt i18n lazy load 700 messages Poll Component Weather Component
Movie Component LINE TODAY i18n setup
Problem 1 Page speed
Problem 1 Page speed
Problem 1 Split Message /\.poll\./ title.poll.page /\.weather\./ info.weather.AQI /\.movie\./ bt.movie.book
poll_zh_TW.json 20 messages weather_zh_TW.json 50 messages movie_zh_TW.json 130 messages lang/zh_TW.json 700 messages 150 messages Others bt.copy
Problem 1 JSON size
Problem 1 JSON size
Problem 1 JSON size
Problem 1 JSON size Real case https://lin.ee/C2LF1Im
Problem 1 Split Message Nuxt i18n lazy load 700 messages
Poll Component Weather Component Movie Component poll_zh_TW.json 20 messages weather_zh_TW.json 50 messages movie_zh_TW.json 130 messages shared 150 messages
Problem 1 Async Component
Problem 1 Solution
Problem 1 Import Message
Problem 2 SSR
Problem 2 SSR import messages import component Async Component 1st
request 2nd request HTML with language Weather.vue Async Component HTML no language Weather.vue
Problem 2 Solution Nuxt Plugin Import 700 messages import 50
messages import component Async Component Weather.vue SSR CSR HTML with language
Problem 2 SSR Solution
Problem 2 SSR Solution
Problem 3 Shared: Module:
Problem 3 JSON vs JS literal Module: Nuxt i18n lazy
load:
Problem 3 Speed https://lin.ee/jtds26s
Problem 3 Create shared JS
Problem 3 Solution
Summary • Split big JSON into small pieces. • Only
import the messages the you need. • Server side: import the whole messages. • Client side: import messages on the fly. • Don’t use JS literal to save i18n message. Use JSON.
Example https://lin.ee/3VzyZnF nuxt-i18n-demo
Q&A
LINE TECH FRESH https://engineering.linecorp.com/zh-hant/blog/tech-fresh-2020/ 34
35