Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
NTUAI企業參訪
line_developers_tw
PRO
0
920
Data TECH FRESH企業參訪- Amber
line_developers_tw
PRO
0
1.1k
Data Team 實習分享
line_developers_tw
PRO
0
2.7k
Backend Intern之旅
line_developers_tw
PRO
0
5.4k
清大企業參訪- Ben
line_developers_tw
PRO
0
1.3k
LLM 商品規格萃取大冒險- Vila
line_developers_tw
PRO
0
1.2k
Playwright/MCP/AI -Winter
line_developers_tw
PRO
0
1.2k
LINE EC Product Catalog Development- Rei
line_developers_tw
PRO
0
1.2k
LINE 與 AI 機器人技術應用現況
line_developers_tw
PRO
0
17
Other Decks in Programming
See All in Programming
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
830
実はマルチモーダルだった。ブラウザの組み込みAI🧠でWebの未来を感じてみよう #jsfes #gemini
n0bisuke2
2
1k
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
ハイパーメディア駆動アプリケーションとIslandアーキテクチャ: htmxによるWebアプリケーション開発と動的UIの局所的適用
nowaki28
0
420
関数実行の裏側では何が起きているのか?
minop1205
1
690
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
130
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
190
TypeScriptで設計する 堅牢さとUXを両立した非同期ワークフローの実現
moeka__c
6
3k
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
120
dotfiles 式年遷宮 令和最新版
masawada
1
770
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
6
2.2k
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Mobile First: as difficult as doing things right
swwweet
225
10k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
For a Future-Friendly Web
brad_frost
180
10k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
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