Permalink
Browse files

added dropdown flags to change locale

  • Loading branch information...
inmarelibero committed Oct 31, 2012
1 parent 78f4656 commit d7843e738d320afcdf08edbfdf1c439ede7b29b8
Showing with 43 additions and 9 deletions.
  1. +4 −2 app/config/locales.yml
  2. +15 −4 src/Bricks/SiteBundle/Resources/less/layout.less
  3. +24 −3 src/Bricks/SiteBundle/Resources/views/layout.html.twig
  4. BIN web/img/flags/ad.png
  5. BIN web/img/flags/ae.png
  6. BIN web/img/flags/af.png
  7. BIN web/img/flags/ag.png
  8. BIN web/img/flags/ai.png
  9. BIN web/img/flags/al.png
  10. BIN web/img/flags/am.png
  11. BIN web/img/flags/an.png
  12. BIN web/img/flags/ao.png
  13. BIN web/img/flags/ar.png
  14. BIN web/img/flags/as.png
  15. BIN web/img/flags/at.png
  16. BIN web/img/flags/au.png
  17. BIN web/img/flags/aw.png
  18. BIN web/img/flags/ax.png
  19. BIN web/img/flags/az.png
  20. BIN web/img/flags/ba.png
  21. BIN web/img/flags/bb.png
  22. BIN web/img/flags/bd.png
  23. BIN web/img/flags/be.png
  24. BIN web/img/flags/bf.png
  25. BIN web/img/flags/bg.png
  26. BIN web/img/flags/bh.png
  27. BIN web/img/flags/bi.png
  28. BIN web/img/flags/bj.png
  29. BIN web/img/flags/bm.png
  30. BIN web/img/flags/bn.png
  31. BIN web/img/flags/bo.png
  32. BIN web/img/flags/br.png
  33. BIN web/img/flags/bs.png
  34. BIN web/img/flags/bt.png
  35. BIN web/img/flags/bv.png
  36. BIN web/img/flags/bw.png
  37. BIN web/img/flags/by.png
  38. BIN web/img/flags/bz.png
  39. BIN web/img/flags/ca.png
  40. BIN web/img/flags/catalonia.png
  41. BIN web/img/flags/cc.png
  42. BIN web/img/flags/cd.png
  43. BIN web/img/flags/cf.png
  44. BIN web/img/flags/cg.png
  45. BIN web/img/flags/ch.png
  46. BIN web/img/flags/ci.png
  47. BIN web/img/flags/ck.png
  48. BIN web/img/flags/cl.png
  49. BIN web/img/flags/cm.png
  50. BIN web/img/flags/cn.png
  51. BIN web/img/flags/co.png
  52. BIN web/img/flags/cr.png
  53. BIN web/img/flags/cs.png
  54. BIN web/img/flags/cu.png
  55. BIN web/img/flags/cv.png
  56. BIN web/img/flags/cx.png
  57. BIN web/img/flags/cy.png
  58. BIN web/img/flags/cz.png
  59. BIN web/img/flags/de.png
  60. BIN web/img/flags/dj.png
  61. BIN web/img/flags/dk.png
  62. BIN web/img/flags/dm.png
  63. BIN web/img/flags/do.png
  64. BIN web/img/flags/dz.png
  65. BIN web/img/flags/ec.png
  66. BIN web/img/flags/ee.png
  67. BIN web/img/flags/eg.png
  68. BIN web/img/flags/eh.png
  69. BIN web/img/flags/england.png
  70. BIN web/img/flags/er.png
  71. BIN web/img/flags/es.png
  72. BIN web/img/flags/et.png
  73. BIN web/img/flags/europeanunion.png
  74. BIN web/img/flags/fam.png
  75. BIN web/img/flags/fi.png
  76. BIN web/img/flags/fj.png
  77. BIN web/img/flags/fk.png
  78. BIN web/img/flags/fm.png
  79. BIN web/img/flags/fo.png
  80. BIN web/img/flags/fr.png
  81. BIN web/img/flags/ga.png
  82. BIN web/img/flags/gb.png
  83. BIN web/img/flags/gd.png
  84. BIN web/img/flags/ge.png
  85. BIN web/img/flags/gf.png
  86. BIN web/img/flags/gh.png
  87. BIN web/img/flags/gi.png
  88. BIN web/img/flags/gl.png
  89. BIN web/img/flags/gm.png
  90. BIN web/img/flags/gn.png
  91. BIN web/img/flags/gp.png
  92. BIN web/img/flags/gq.png
  93. BIN web/img/flags/gr.png
  94. BIN web/img/flags/gs.png
  95. BIN web/img/flags/gt.png
  96. BIN web/img/flags/gu.png
  97. BIN web/img/flags/gw.png
  98. BIN web/img/flags/gy.png
  99. BIN web/img/flags/hk.png
  100. BIN web/img/flags/hm.png
  101. BIN web/img/flags/hn.png
  102. BIN web/img/flags/hr.png
  103. BIN web/img/flags/ht.png
  104. BIN web/img/flags/hu.png
  105. BIN web/img/flags/id.png
  106. BIN web/img/flags/ie.png
  107. BIN web/img/flags/il.png
  108. BIN web/img/flags/in.png
  109. BIN web/img/flags/io.png
  110. BIN web/img/flags/iq.png
  111. BIN web/img/flags/ir.png
  112. BIN web/img/flags/is.png
  113. BIN web/img/flags/it.png
  114. BIN web/img/flags/jm.png
  115. BIN web/img/flags/jo.png
  116. BIN web/img/flags/jp.png
  117. BIN web/img/flags/ke.png
  118. BIN web/img/flags/kg.png
  119. BIN web/img/flags/kh.png
  120. BIN web/img/flags/ki.png
  121. BIN web/img/flags/km.png
  122. BIN web/img/flags/kn.png
  123. BIN web/img/flags/kp.png
  124. BIN web/img/flags/kr.png
  125. BIN web/img/flags/kw.png
  126. BIN web/img/flags/ky.png
  127. BIN web/img/flags/kz.png
  128. BIN web/img/flags/la.png
  129. BIN web/img/flags/lb.png
  130. BIN web/img/flags/lc.png
  131. BIN web/img/flags/li.png
  132. BIN web/img/flags/lk.png
  133. BIN web/img/flags/lr.png
  134. BIN web/img/flags/ls.png
  135. BIN web/img/flags/lt.png
  136. BIN web/img/flags/lu.png
  137. BIN web/img/flags/lv.png
  138. BIN web/img/flags/ly.png
  139. BIN web/img/flags/ma.png
  140. BIN web/img/flags/mc.png
  141. BIN web/img/flags/md.png
  142. BIN web/img/flags/me.png
  143. BIN web/img/flags/mg.png
  144. BIN web/img/flags/mh.png
  145. BIN web/img/flags/mk.png
  146. BIN web/img/flags/ml.png
  147. BIN web/img/flags/mm.png
  148. BIN web/img/flags/mn.png
  149. BIN web/img/flags/mo.png
  150. BIN web/img/flags/mp.png
  151. BIN web/img/flags/mq.png
  152. BIN web/img/flags/mr.png
  153. BIN web/img/flags/ms.png
  154. BIN web/img/flags/mt.png
  155. BIN web/img/flags/mu.png
  156. BIN web/img/flags/mv.png
  157. BIN web/img/flags/mw.png
  158. BIN web/img/flags/mx.png
  159. BIN web/img/flags/my.png
  160. BIN web/img/flags/mz.png
  161. BIN web/img/flags/na.png
  162. BIN web/img/flags/nc.png
  163. BIN web/img/flags/ne.png
  164. BIN web/img/flags/nf.png
  165. BIN web/img/flags/ng.png
  166. BIN web/img/flags/ni.png
  167. BIN web/img/flags/nl.png
  168. BIN web/img/flags/no.png
  169. BIN web/img/flags/np.png
  170. BIN web/img/flags/nr.png
  171. BIN web/img/flags/nu.png
  172. BIN web/img/flags/nz.png
  173. BIN web/img/flags/om.png
  174. BIN web/img/flags/pa.png
  175. BIN web/img/flags/pe.png
  176. BIN web/img/flags/pf.png
  177. BIN web/img/flags/pg.png
  178. BIN web/img/flags/ph.png
  179. BIN web/img/flags/pk.png
  180. BIN web/img/flags/pl.png
  181. BIN web/img/flags/pm.png
  182. BIN web/img/flags/pn.png
  183. BIN web/img/flags/pr.png
  184. BIN web/img/flags/ps.png
  185. BIN web/img/flags/pt.png
  186. BIN web/img/flags/pw.png
  187. BIN web/img/flags/py.png
  188. BIN web/img/flags/qa.png
  189. BIN web/img/flags/re.png
  190. BIN web/img/flags/ro.png
  191. BIN web/img/flags/rs.png
  192. BIN web/img/flags/ru.png
  193. BIN web/img/flags/rw.png
  194. BIN web/img/flags/sa.png
  195. BIN web/img/flags/sb.png
  196. BIN web/img/flags/sc.png
  197. BIN web/img/flags/scotland.png
  198. BIN web/img/flags/sd.png
  199. BIN web/img/flags/se.png
  200. BIN web/img/flags/sg.png
  201. BIN web/img/flags/sh.png
  202. BIN web/img/flags/si.png
  203. BIN web/img/flags/sj.png
  204. BIN web/img/flags/sk.png
  205. BIN web/img/flags/sl.png
  206. BIN web/img/flags/sm.png
  207. BIN web/img/flags/sn.png
  208. BIN web/img/flags/so.png
  209. BIN web/img/flags/sr.png
  210. BIN web/img/flags/st.png
  211. BIN web/img/flags/sv.png
  212. BIN web/img/flags/sy.png
  213. BIN web/img/flags/sz.png
  214. BIN web/img/flags/tc.png
  215. BIN web/img/flags/td.png
  216. BIN web/img/flags/tf.png
  217. BIN web/img/flags/tg.png
  218. BIN web/img/flags/th.png
  219. BIN web/img/flags/tj.png
  220. BIN web/img/flags/tk.png
  221. BIN web/img/flags/tl.png
  222. BIN web/img/flags/tm.png
  223. BIN web/img/flags/tn.png
  224. BIN web/img/flags/to.png
  225. BIN web/img/flags/tr.png
  226. BIN web/img/flags/tt.png
  227. BIN web/img/flags/tv.png
  228. BIN web/img/flags/tw.png
  229. BIN web/img/flags/tz.png
  230. BIN web/img/flags/ua.png
  231. BIN web/img/flags/ug.png
  232. BIN web/img/flags/um.png
  233. BIN web/img/flags/us.png
  234. BIN web/img/flags/uy.png
  235. BIN web/img/flags/uz.png
  236. BIN web/img/flags/va.png
  237. BIN web/img/flags/vc.png
  238. BIN web/img/flags/ve.png
  239. BIN web/img/flags/vg.png
  240. BIN web/img/flags/vi.png
  241. BIN web/img/flags/vn.png
  242. BIN web/img/flags/vu.png
  243. BIN web/img/flags/wales.png
  244. BIN web/img/flags/wf.png
  245. BIN web/img/flags/ws.png
  246. BIN web/img/flags/ye.png
  247. BIN web/img/flags/yt.png
  248. BIN web/img/flags/za.png
  249. BIN web/img/flags/zm.png
  250. BIN web/img/flags/zw.png
View
@@ -6,10 +6,12 @@ parameters:
# array of available interface translations
interface_translation_locales:
- -
+ en:
code: en
- -
+ flag: gb.png
+ it:
code: it
+ flag: it.png
# parameter to be used in routes.yml
# add |[locale] if a new interface locale is available
@@ -118,11 +118,22 @@ MAIN NAVBAR
}
li#nav-locales {
+ margin-top: 2px;
padding-left: 20px;
- a {
- display: inline-block;
- padding-left: 3px;
- padding-right: 3px;
+ .btn-group { z-index: 0;
+ & > .btn { padding-bottom: 6px; }
+ .dropdown-menu {
+ min-width: 0px;
+ z-index: -1;
+ margin-top: -12px;
+ padding: 10px 0px 4px 0px;
+
+ a {
+ display: inline-block;
+ padding-left: 16px;
+ padding-right: 16px;
+ }
+ }
}
}
}
@@ -62,9 +62,30 @@
</form>
</li>
<li id="nav-locales">
- {% for locale in interface_translation_locales %}
- <a href="{{ path('homepage', {'_locale': locale.code}) }}">{{ locale.code }}</a>
- {% endfor %}
+ <div class="btn-group">
+ <button class="btn btn-mini">
+ {% if interface_translation_locales[app.request.locale] is not null %}
+ <img src="{{ asset('img/flags/'~interface_translation_locales[app.request.locale]['flag']) }}">
+ {% else %}
+ {{ app.request.locale }}
+ {% endif %}
+ </button>
+ <button class="btn btn-mini dropdown-toggle" data-toggle="dropdown">
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu">
+ {% for locale in interface_translation_locales %}
+ <li>
+ <a href="{{ path('homepage', {'_locale': locale.code}) }}">
+ <img src="{{ asset('img/flags/'~locale.flag) }}">
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+ {#
+ #}
+ </select>
</li>
</ul>
<ul class="nav pull-right">
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View