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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
HeChien Hsu
March 29, 2014
Programming
220
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
Transcript
28 slides
國際化影⽚片分享網站 徐赫謙
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
More Decks by HeChien Hsu
See All by HeChien Hsu
Using Git hosting
hechien
0
67
[Wheel Lab #2] Apple Service with Rails.
hechien
0
130
[Sokoos][教育訓練] Git - 1
hechien
0
190
[數位教學] 用Bootstrap製作網頁
hechien
0
1.4k
DesignYou - 專題報告投影片
hechien
0
160
[作業] 創意美學
hechien
0
95
[教育訓練] Rails Form Basic
hechien
1
92
[教育訓練] Rails Validation Basic
hechien
1
130
Rails Layout Basic
hechien
2
140
Other Decks in Programming
See All in Programming
疎結合とは何か?ソフトウェア設計における結合バランスについて考える #phpcon_niigata
kajitack
2
450
コード生成時代のAPI定義を支えるRequest Spec移行
pvcresin
0
320
どうしても Eloquent でリポジトリパターンをやりたいんだ #phpcon_niigata / phpcon-niigata-2026
shogogg
0
720
はじめてのKubernetesコントリビューション
nasa9084
0
330
正解の無い問題を 「できるだけ上手く」解く ヒューリスティックで感性を磨こう。〜現実課題をプログラミングで解きあうコミュニティについて〜
allegrogiken
0
120
LLM 101
dalinaum
0
560
Lean で手続き的プログラム の証明が書けるようになった
inoueasei
11
6.1k
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
650
AIと速く作れる時代に、要求と設計をどう確かめるか ーイベントストーミングとSDDの実践ー
syobochim
0
200
Apache Airflow Introduction
leew
1
100
Math.sumPreciseから学ぶ、ECMAScript仕様の数値の種類
syumai
1
1.6k
はじめてのPLATEAU
nokonoko1203
1
680
Featured
See All Featured
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
530
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
620
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Un-Boring Meetings
codingconduct
0
520
Side Projects
sachag
456
43k
Become a Pro
speakerdeck
PRO
31
6.4k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
310
The Language of Interfaces
destraynor
162
27k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
61k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.7k
Building a Scalable Design System with Sketch
lauravandoore
464
34k