Allow a theme lang file

Bug #1362871 reported by Robert Lyon on 2014-08-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Wishlist
Robert Lyon

Bug Description

Sometimes a theme may have a homeinfo.tpl file that contains hardcoded lang strings.

But there is no relating lang file to make things easy to translate.

So I've got the system to check for a theme language file.

Robert Lyon (robertl-9) on 2014-08-29
tags: added: nominatedfeature
Changed in mahara:
importance: Low → Wishlist
milestone: 1.10.0 → 1.11.0
Robert Lyon (robertl-9) on 2014-08-31
Changed in mahara:
milestone: 1.11.0 → 1.10.0
Aaron Wells (u-aaronw) wrote :

Patch: https://reviews.mahara.org/#/c/3628

As described in the commit header, to use it in a template you need to indicate the section is a theme by
going:

 {str tag=stringtoget section=theme.nameoftheme}

... and this will look for the lang file in: theme/nameoftheme/lang/langtype/nameoftheme.php

We need to make sure that this works with external langpacks and with /local lang overrides. It looks like it works the same way that plugin lang strings do (by adding to a set of search paths that get_string() uses) but we should explicitly test it.

Reviewed: https://reviews.mahara.org/3673
Committed: http://gitorious.org/mahara/mahara/commit/03ff102ae65a8f5f989eb9696f3c9be75e34bba7
Submitter: Ghada El-Zoghbi (<email address hidden>)
Branch: master

commit 03ff102ae65a8f5f989eb9696f3c9be75e34bba7
Author: Robert Lyon <email address hidden>
Date: Fri Aug 29 12:26:18 2014 +1200

Language-ifying the strings in the primary school theme (Bug 1362871)

Currently there is no way for themes to come with their own language
files - but sometimes a theme may have some text it wants to display
that is unique to that theme - like when it has a homeinfo.tpl file

I've added the checks to the lang path for checking a theme's lang file

To use it in a template you need to indicate the section is a theme by
going:

{str tag=stringtoget section=theme.nameoftheme}

and this will look for the lang file in:
./theme/nameoftheme/lang/langtype/nameoftheme.php

Change-Id: I16d5273ee94ad2c066f7de5922253edde325fbed
Signed-off-by: Robert Lyon <email address hidden>

Reviewed: https://reviews.mahara.org/3698
Committed: http://gitorious.org/mahara/mahara/commit/b716d8ed302a73b29a9a4bdf8327a49a7f0bdc06
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit b716d8ed302a73b29a9a4bdf8327a49a7f0bdc06
Author: Aaron Wells <email address hidden>
Date: Mon Sep 15 19:11:41 2014 +1200

Change theme lang files to follow naming convention of plugin naming files

Bug 1362871
e.g.: theme/primaryschool/lang/en.utf8/theme.primaryschool.php

Change-Id: I267822316494778bd4fc879ccff8dfba97a29c1b

Robert Lyon (robertl-9) on 2014-09-15
Changed in mahara:
status: In Progress → Fix Committed
Aaron Wells (u-aaronw) on 2014-10-21
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers