~etalab/code.gouv.fr

b11650742b75a97226337f1f145850f6de691805 — Bastien Guerry 10 days ago 45e009a
Set the <html> lang attribute dynamically
2 files changed, 5 insertions(+), 1 deletions(-)

M resources/public/index.html
M src/cljs/codegouvfr/core.cljs
M resources/public/index.html => resources/public/index.html +1 -1
@@ 1,5 1,5 @@
<!DOCTYPE html>
<html data-fr-scheme="" lang="fr">
<html id="html" data-fr-scheme="">
  <head>
    <title>code.gouv.fr - Codes sources du secteur public - French Public Sector Sources Codes</title>
    <meta charset="utf-8">

M src/cljs/codegouvfr/core.cljs => src/cljs/codegouvfr/core.cljs +4 -0
@@ 8,6 8,7 @@
            [reagent.core :as reagent]
            [reagent.dom]
            [cljs-bean.core :refer [bean]]
            [clojure.browser.dom :as dom]
            [goog.string :as gstring]
            [ajax.core :refer [GET]]
            [codegouvfr.i18n :as i]


@@ 272,6 273,9 @@
(re-frame/reg-event-db
 :lang!
 (fn [db [_ lang]]
   (dom/set-properties
    (dom/get-element "html")
    {"lang" lang})
   (assoc db :lang lang)))

(re-frame/reg-event-db