Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Symfony2のi18n対応

 Symfony2のi18n対応

Symfony Meetup #11の発表資料

はない

April 24, 2016
Tweet

More Decks by はない

Other Decks in Technology

Transcript

  1. 4UFQϧʔςΟϯάʹݴޠ MPDBMF Λ௥Ճ͢Δɻ    !3PVUF \@MPDBMF^  

    EFGBVMUT\@MPDBMFKB^   SFRVJSFNFOUT\  @MPDBMFKBcFO   ^      QVCMJDGVODUJPOMBOHVBHF"DUJPO 3FRVFTUSFRVFTU  \ JOGPSNBUJPO݄ͱ݄ͷ৽ண৘ใΛ௥Ճ͠·ͨ͠ɻ SFUVSOUIJTSFOEFS 5PQQBHFJOEFYIUNMUXJH  <JOGPSNBUJPOJOGPSNBUJPO>   ^ ˏ"QQ#VOEMF5PQQBHF$POUSPMMFS 
  2. 4UFQ຋༁ϑΝΠϧΛ࡞Δɻ ˏ3FTPVSDFTUSBOTMBUJPOTNFTTBHFTFOZNM  btn: detail: Detail navi: title: Classic Symfony

    Orchestra top: Top performance: Performance information profile: About us blog: Blog inquiry: Inquiry ・ ・ ・
  3. 4UFQUXJHͷදࣔΛෳ਺ݴޠʹରԠ͢Δɻ ˏ3FTPVSDFTWJFXT5PQQBHFJOEFYIUNMUXJH  <section id="just-intro"> <div class="container”> ・・・ <h4><strong>{{ 'navi.performance'|trans

    }}</strong></h4> <p> {{ 'performance.message.main'|trans|nl2br }} </p> <a href="{{ path("app_concert_index") }}" class="btn btn-primary"> {{ 'btn.detail'|trans }} </a> ・・・ </div> </section>
  4. 

  5. OFYUTUFQ @AppBundle/Twig/MLangExtension ・・・ public function multiTrans($message, array $arguments = array(),

    $domain = null, $locale = null, $subLocale = null) { $str = ""; $str .= $this->translator->trans($message, $arguments, $domain, $locale); $str .= "\n"; $str .= $this->translator->trans($message, $arguments, $domain, ! empty($subLocale) ? $subLocale : $this->subLocale); return $str; } ・・・ http://symfony.com/doc/current/cookbook/templating/twig_extension.html