Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
[Kaohsiung Rails meetup] 國際化影片分享網站
Search
HeChien Hsu
March 29, 2014
Programming
190
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
[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
66
[Wheel Lab #2] Apple Service with Rails.
hechien
0
110
[Sokoos][教育訓練] Git - 1
hechien
0
170
[數位教學] 用Bootstrap製作網頁
hechien
0
1.4k
DesignYou - 專題報告投影片
hechien
0
140
[作業] 創意美學
hechien
0
79
[教育訓練] Rails Form Basic
hechien
1
88
[教育訓練] Rails Validation Basic
hechien
1
110
Rails Layout Basic
hechien
2
140
Other Decks in Programming
See All in Programming
wkhtmltopdfの次どうするか問題2026
willnet
2
1.8k
iOSDC2026登壇資料.pdf
riofujimon
0
200
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
370
カツオ、ご期待ください
suneo3476
0
140
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
150
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
120
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
5.9k
Verilogで学ぶCPU自作入門.pdf
uyuki234
7
3.9k
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
1
430
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
130
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
260
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
The SEO identity crisis: Don't let AI make you average
varn
0
570
Code Review Best Practice
trishagee
74
20k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Designing Powerful Visuals for Engaging Learning
tmiket
1
590
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
860
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
490
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Amusing Abliteration
ianozsvald
1
320
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
How to build a perfect <img>
jonoalderson
1
6.1k
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