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
[Kaohsiung Rails meetup] 國際化影片分享網站
Search
HeChien Hsu
March 29, 2014
Programming
170
0
Share
[Kaohsiung Rails meetup] 國際化影片分享網站
2014-03-29 分享於高雄 Rails meetup
HeChien Hsu
March 29, 2014
More Decks by HeChien Hsu
See All by HeChien Hsu
Using Git hosting
hechien
0
49
[Wheel Lab #2] Apple Service with Rails.
hechien
0
88
[Sokoos][教育訓練] Git - 1
hechien
0
160
[數位教學] 用Bootstrap製作網頁
hechien
0
1.3k
DesignYou - 專題報告投影片
hechien
0
120
[作業] 創意美學
hechien
0
62
[教育訓練] Rails Form Basic
hechien
1
79
[教育訓練] Rails Validation Basic
hechien
1
89
Rails Layout Basic
hechien
2
130
Other Decks in Programming
See All in Programming
Agentic Elixir
whatyouhide
0
370
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
800
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
150
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
160
Don't Prompt Harder, Structure Better
kitasuke
0
780
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
840
Swift Concurrency Type System
inamiy
1
540
セグメントとターゲットを意識するプロポーザルの書き方 〜採択の鍵は、誰に刺すかを見極めるマーケティング戦略にある〜
m3m0r7
PRO
0
560
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
230
AIエージェントで業務改善してみた
taku271
0
540
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
280
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
180
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
180
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
520
4 Signs Your Business is Dying
shpigford
187
22k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
530
Into the Great Unknown - MozCon
thekraken
41
2.4k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
220
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Mind Mapping
helmedeiros
PRO
1
160
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
220
The Language of Interfaces
destraynor
162
26k
GitHub's CSS Performance
jonrohan
1032
470k
Transcript
國際化影⽚片分享網站 徐赫謙
About me • 徐赫謙 - HeChien Hsu •
[email protected]
•
http://fb.com/hechien • http://hechien.logdown.com
國際化?
I18n Internationalization
影⽚片分享?
不是真的上傳影⽚片
Share the video links
請你跟我這樣做
rails new my_videos
rails g scaffold video title link
rake db:migrate
我們需要這些 Gem
我們需要這些 Gem • rails • embedly # 抓 video link
⽤用 • faraday # embedly 說它要存在才讓我⽤用 T_T • settingslogic # 為了儲存⼀一些設定
關於「分享影⽚片」 • 其實就是透過 embedly 去抓取影⽚片資料
ShareLinkService • https://gist.github.com/hechien/ f317ebf120e573c96daf#file-share_link_service- rb • 把它放在你的 app/services 底下,命名為 share_link_service.rb
關於「國際化」 • 國際化分為兩件事 • i18n • Timezone
Internationalization • 簡稱:i18n (不然真的太⻑⾧長) • 在 /config/application.rb • config.i18n.default_locale =
:zh-TW • 語系檔放在 /config/locales ⽤用 YAML 撰寫
Internationalization (cont.) • I18n.t(key) # 任何地⽅方皆可使⽤用 • I18n.t(key, scope: scope)
# 任何地⽅方皆可使⽤用, 並指定 scope • t(key) # View Helper • t(key, scope: scope) # View Helper with scope
Timezone • rake time:zones:all # 得到所有時區清單 • rake time:zones:us #
美國地區的時區清單 • rake time:zones:local # 當前地區的時區清單 • rake time:zones:all OFFSET=8 # +08:00 的地區
Timezone (cont.) • time_zone_select # FormHelper
Timezone (cont.) • Time.current • Date.current • 10.days.ago • 1.days.from_now
• … • 以上都會吃到 Timezone 設定
Timezone (cont.) • Time.now / Date.today => 沒有吃到 Timezone 設
定
DEMO
懶得寫⼀一堆 i18n 怎辦
懶得寫⼀一堆 i18n 怎辦 • rails-i18n • http://github.com/svenfuchs/rails-i18n
為薄滴賽 • ⼀一個討論 Web Design / Development 的 Facebook Group
Q & A
Thank you