mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #27464
[Bug 1468144] Re: Page layout thumbnails are broken if you use a locale that does commas for decimals
Replication instructions:
To test this, you'll need to change your Locale. For Ubuntu, you can do
that using instructions from here: http://askubuntu.com/questions/76013
/how-do-i-add-locale-to-ubuntu-server
1. Install the Dutch language locale on your computer:
sudo locale-gen nl_NL.UTF-8
sudo update-locale
2. You'll also need to force Mahara to use that new locale. Normally,
Mahara uses a method called "set_locale_for_language()" to try to set
the locale to match the current language pack. So you can either install
the Dutch language pack, or hack set_locale_for_language(). It's in the
htdocs/lib/mahara.php file. Add this to the top of the
set_locale_for_language() function:
setlocale(LC_ALL, 'nl_NL.UTF-8');
return;
3. Having done this, log in to Mahara and go to Portfolio -> Pages.
4. Create or edit a page, and go to the "Layout" tab
Expected result: You should see thumbnails for all the layouts
Actual result: Thumbnails for several layouts will be missing
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1468144
Title:
Page layout thumbnails are broken if you use a locale that does commas
for decimals
Status in Mahara ePortfolio:
New
Bug description:
This bug is a follow-up to Bug 1461040. The code in Mahara that
generates SVG files for page layouts, breaks if you are using a locale
that does commas for decimals, instead of periods. e.g. one half is
"0,5" rather than "0.5".
Here's a quote from the other bug:
I also encountered this after beginning with translation of Mahara
15.04 into Estonian. As the locale setting have also been changed the
values returned by PHP (please correct me if I am wrong) will be comma
separated and not separated with decimal point (due to Estonian
representation of float numbers). So Peter probably sees only the SVG
images which are not returned with float values. Small output of false
return values which are not rendered by browser: <rect x="52,2"
y="18"..></rect>. (should be x="52.2")
This also affects gallery where the images should be centered but due
to false float values are not.
The fix provided at the moment helps, but does not solve the float
number representation. I have chosen to replace "," in returned values
with "." in layoutpreviewimage.php and it has "solved" the problem. I
am open for better solutions.
I hope this helps a bit.
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1468144/+subscriptions
References