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
48
[Wheel Lab #2] Apple Service with Rails.
hechien
0
86
[Sokoos][教育訓練] Git - 1
hechien
0
160
[數位教學] 用Bootstrap製作網頁
hechien
0
1.3k
DesignYou - 專題報告投影片
hechien
0
120
[作業] 創意美學
hechien
0
62
[教育訓練] Rails Form Basic
hechien
1
78
[教育訓練] Rails Validation Basic
hechien
1
88
Rails Layout Basic
hechien
2
130
Other Decks in Programming
See All in Programming
Geminiをパートナーに神社DXシステムを個人開発した話(いなめぐDX 開発振り返り)
fujiba
0
130
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
580
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
440
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
740
存在論的プログラミング: 時間と存在を記述する
koriym
5
730
AIと共にエンジニアとPMの “二刀流”を実現する
naruogram
0
110
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
110
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
160
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
210
Coding as Prompting Since 2025
ragingwind
0
620
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
420
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
9
790
Designing Experiences People Love
moore
143
24k
ラッコキーワード サービス紹介資料
rakko
1
2.8M
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
92
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
120
How STYLIGHT went responsive
nonsquared
100
6k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
We Are The Robots
honzajavorek
0
210
Bash Introduction
62gerente
615
210k
Skip the Path - Find Your Career Trail
mkilby
1
93
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