mysociety / alaveteli

Provide a Freedom of Information request system for your jurisdiction
https://alaveteli.org
Other
387 stars 195 forks source link

gettext:find_theme obsoletes core overrides in locale-theme #2033

Open garethrees opened 9 years ago

garethrees commented 9 years ago

The locale-theme files are meant to be able to override core translations:

# Your theme's locale files will override the core locale files.  This
# is a good place to put both translations specific to your theme, and
# "translations" of the core English words (e.g. you might want to
# call FOI "RTI" throughougout, like this:

msgid "Make and browse Freedom of Information (FOI) requests"
msgstr "Make and browse Right to Know (RTI) requests"

https://github.com/mysociety/alavetelitheme/blob/master/locale-theme/en/app.po

Running rake gettext:find_theme immediately obsoletes these translation strings:

$ bundle exec rake gettext:find_theme THEME=alavetelitheme
/home/vagrant/alaveteli/lib/themes/alavetelitheme/locale-theme/app.pot . done.
/home/vagrant/alaveteli/lib/themes/alavetelitheme/locale-theme/en/app.po . done.
diff --git a/locale-theme/en/app.po b/locale-theme/en/app.po
index d2da165..6ff44d1 100644
--- a/locale-theme/en/app.po
+++ b/locale-theme/en/app.po
@@ -1,7 +1,24 @@
+msgid "Authority has transferred your request to a different public body."
+msgstr ""
+
+msgid "Is {{email_address}} the wrong address for {{type_of_request}} requests to {{public_body_name}}? If so, please contact us using this form:"
+msgstr ""
+
+msgid "Please use this email address for all replies to this request:"
+msgstr ""
+
+msgid "This is an FOI request done via the {{site_name}} website. This footer has been overriden by the sample Alaveteli theme."
+msgstr ""
+
+msgid "Transferred."
+msgstr ""
+
+msgid "unknown status "
+msgstr ""
+
 # Your theme's locale files will override the core locale files.  This
 # is a good place to put both translations specific to your theme, and
 # "translations" of the core English words (e.g. you might want to
 # call FOI "RTI" throughougout, like this:
-
-msgid "Make and browse Freedom of Information (FOI) requests"
-msgstr "Make and browse Right to Know (RTI) requests"
\ No newline at end of file
+#~ msgid "Make and browse Freedom of Information (FOI) requests"
+#~ msgstr "Make and browse Right to Know (RTI) requests"
garethrees commented 9 years ago

Overriding (with no modifications) a template that uses the msgid allows rake gettext:find_theme to use the translation override.

$ mkdir ~/Code/alaveteli-themes/alavetelitheme/lib/views/layouts/
$ cp ~/Code/alaveteli/app/views/layouts/default.html.erb ~/Code/alaveteli-themes/alavetelitheme/lib/views/layouts/
$ bundle exec rake gettext:find_theme THEME=alavetelitheme
/home/vagrant/alaveteli/lib/themes/alavetelitheme/locale-theme/app.pot /home/vagrant/alaveteli/lib/themes/alavetelitheme/locale-theme/en/app.po . done.
diff --git a/locale-theme/en/app.po b/locale-theme/en/app.po
index d2da165..2a0cdf9 100644
--- a/locale-theme/en/app.po
+++ b/locale-theme/en/app.po
@@ -1,7 +1,30 @@
+msgid "Authority has transferred your request to a different public body."
+msgstr ""
+
+msgid "Close"
+msgstr ""
+
+msgid "Is {{email_address}} the wrong address for {{type_of_request}} requests to {{public_body_name}}? If so, please contact us using this form:"
+msgstr ""
+
 # Your theme's locale files will override the core locale files.  This
 # is a good place to put both translations specific to your theme, and
 # "translations" of the core English words (e.g. you might want to
 # call FOI "RTI" throughougout, like this:
-
 msgid "Make and browse Freedom of Information (FOI) requests"
-msgstr "Make and browse Right to Know (RTI) requests"
\ No newline at end of file
+msgstr "Make and browse Right to Know (RTI) requests"
+
+msgid "Paste this link into emails, tweets, and anywhere else:"
+msgstr ""
+
+msgid "Please use this email address for all replies to this request:"
+msgstr ""
+
+msgid "This is an FOI request done via the {{site_name}} website. This footer has been overriden by the sample Alaveteli theme."
+msgstr ""
+
+msgid "Transferred."
+msgstr ""
+
+msgid "unknown status "
+msgstr ""
garethrees commented 7 years ago

Related to https://github.com/mysociety/alaveteli/pull/3914 and https://github.com/mysociety/alaveteli/issues/1638