How to work with localization/translations in Firefox OS/b2g - firefox

There seem to be a lot of variations of how the workflow for localization should be. When I look at the documentation I find differences on all of the pages:
https://developer.mozilla.org/en-US/Apps/Build/Localization/Localizing_Firefox_OS_Apps
https://developer.mozilla.org/en-US/Apps/Build/Localization/Getting_started_with_app_localization
https://developer.mozilla.org/en-US/Apps/Build/Localization/Localizing_strings_in_JavaScript
https://github.com/robnyman/TranslationTester
https://github.com/robnyman/Firefox-OS-Boilerplate-App
I have tried all versions and combinations that I can think of (my phone is a Geeksphone Revolution running Firefox OS 2.0) but nothing works as intended. Either I get no text at all or I always get English.
To name one of the uncertainties, how should the localization link-tag look like. So far I have tried these variations (each with corresponding file structure for .ini/.properties files):
<link rel="prefetch" type="application/l10n" href="locales/locales.ini">
<link rel="resource" type="application/l10n" href="locales/locales.ini">
<link rel="localization" href="locales/{locale}/app.properties">
<link rel="prefetch" href="locales/{locale}/app.properties">
Since all documentation pages on developer.mozilla.org and the GitHub pages they link to looks different, how can I find out which is the standard way to work with localization for Firefox OS/b2g 2.x?

I believe this link:
https://developer.mozilla.org/en-US/Apps/Build/Localization/Localizing_Firefox_OS_Apps
reflects the latest changes in the l10n.js lib in Gaia.
The other methods can be used as long as you have the js file that supports it.
For example The translation tester app should work. I just tried it on 2.0 on a Flame and it worked fine.
Using
<link rel="resource" type="application/l10n" href="locales/locales.ini" />
Should work.
Look over this post:
https://hacks.mozilla.org/2014/05/introducing-translationtester-and-localization-support-for-open-web-apps/
That Robert used with that example and uses a locales.ini file in the locales directory.
Also check to see if your app is working in the 2.0 simulator.

Related

My Foundation Icons are not working in Firefox. Only letters in a box display instead

The Html
<link rel=stylesheet href=../static/css/foundation-icons/foundation-icons.css>
<a class="button radius search-header"><i class="fi-magnifying-glass"></i> Search</a>
I have navigated to foundation-icons.css after hitting Ctrl+U within Firefox so I am definitely linking to the file correctly.
I have copied the foundation-icons folder exactly and not removed anything. It looks like this:
./static/css/foundation-icons/
- foundation-icons.css
- foundation-icons.eot
- foundation-icons.svg
- foundation-icons.ttf
- foundation-icons.woff
- svgs/*
- preview.html
Edit: I have changed the title and added the Firefox tag because everything seems to be working fine in Chromium. I am a little stumped because that means it's a Firefox issue and probably not possible for me to fix.
The preview.html file that comes with foundation-icons works correctly in my Firefox as well.
If you're using the SCSS files, you should point the $fi-path variable to the correct location of your foundation-icon-fonts folder.
For me I had to add the following before importing foundation-icon-fonts:
$fi-path: 'foundation-icon-fonts';
First correct this:
<link rel="stylesheet" href="../static/css/foundation-icons/foundation-icons.css">
In examples of Foundation, Firefox use .woff files. Check if you have access to them.
It's a relative path. Are you sure 'static' folder is reachable with your browser ?

js and css filename being corrupted on publish with VS2013

I am publishing my Web App using the VS2013 publish mechanism. For some reason it has just started corrupting the js and css filenames. e.g.
From
<link href="/Content/bootstrap.css" rel="stylesheet"/>
To
<link href="/Content/css?v=puREEettBuwGkRK7y27hOQwXg4qvcAYRnG8wxc0gvnU1" rel="stylesheet"/>
This is only happening on publish to the live site. It works fine on publish to the localhost site. It looks like possibly some kind of versioning.
The defined bundles in BundleConfig are not being expanded, instead parsed with the above result.
Any ideas? I have not seen it before and its not showing up on Google searches. Thanks for any suggestions.
ANSWER:
For anyone else getting this problem - Once I realised it was the Bundles I found this which gave a lots of thoughts. However my specific issue was that I had installed Select2 via NuGet which had added a css directory in Content. As I was creating a Bundle pointing at Content\css these clashed. I removed the css directory and republished. Still didn't work. But when I removed that directory on the server manually it all started working again.

Change image icon in addressbar of browser

I searched through many sites, but I failed to get an answer.
Question :
I want to change icon as per given in below image in my browser.
Currently chrome and Mozilla does not support this feature if you want check you can check it in either ie or safari, it will show where you want.
you should add this tag to head
<link rel="shortcut icon" href="<YOUR ICON PATH>">
this is a tool to help you to create icon using converter
http://www.favicongenerator.com/
Those are called "favicons", and you can set one for your website using a special tag in the HEAD of your HTML. You can find many tutorials on this by Googling (now that you know what they're called).
Wikipedia suggests a tag something like this:
<link rel="shortcut icon" href="http://example.com/myicon.ico" />
As an alternative, your website can provide an image named favicon.ico in the root folder.
That icon names "favicon". To create Something like that go to THIS LINK, Upload an image and get the favicon.ico file, then put it next to your template page on your host.
To get more information go HERE.

TinyMCE not working in IE9

I have been using TinyMCE WYSIWYG in CMSMS(CMS Made simple), its working in all other browsers like FF,IE7,8,Google Chrome & Safari but its not working in IE9,
When i try to update any data and then save it, its look good with successfully save message but actually its not at all saved my changes.
i'm very much tired by goggling for this issue but get no success at all.:(
i have seen that this is the issue which also occur in JOOMLA 1.5X. in joomla if we are suppose try to write anything in Editor then all save,apply and cancel button not been worked.
Please help me out from this unusual error.
i appreciate your efforts.
Thanks.
Mark Dexter from Joomla! CMS Development says:
This is a perfect example of the problems we run into when trying to
support a version like 1.5 for such a long period of time. On the one
hand, we want to stay up with current versions of 3p software. On the
other hand, we want to maintain backward compatibility. These two
goals become difficult if not impossible over such a long time period
(> 3 years). Mark
As a workaround you could use JCE, which is using a far newer version of TinyMCE and its based on it.
http://extensions.joomla.org/extensions/edition/editors/88
Secondly you could try manually updating TinyMCE to 3.4.x, which fixes the problem download and extract
http://github.com/downloads/tinymce/tinymce/tinymce_3.4.4.zip into /plugins/editors/tinymce
/jscripts/tiny_mce
Good Luck
Just logout from your Admin Console once and then login again..But before logging in,make sure,you change the URL in your browser..
If its http://yourdomain.com, then make it http://www.yourdomain.com and then login..
That should work :)
Another permanent fix for this is;
or you can use more advanced Editors like com_jce
Just use
<meta http-equiv="X-UA-Compatible" content="IE=8" >
In your header tag and IE9 should emulate IE8.
If that still doesn't work try to get it to render in IE7 compatibility. This is not something I would struggle with I would just turn on compatibility till the next release of TinyMCE:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >

AbcPdf - document not applying CSS

This may be more of a tech support issue, but I'm wondering if any other developers have come across this:
I'm using Abcpdf in my ASP.NET code to generate a PDF from HTML. It works fine, but one user is generating PDFs that don't have the CSS applied (IE8, Adobe Acrobat latest version - same as everyone else). Since this is the only user complaining, I'm sure it's a local setting, but I can't figure out what would prevent the css from loading - a browser setting? An Acrobat setting?
Does anyone have any suggestions?
Perhaps an issue with different versions of Acrobat reader? I'd look into this.
This doesn't make a lot of sense because AbcPdf uses service side logic to create the PDF based on what methods you are using to create the document (ex. AddImageUrl vs drawing out the document manually, etc.).
For what it's worth the staff at WebSuperGoo (the vendor of AbcPdf) is great with replying to support questions such as this. I've run across a few edge cases with their product that they've always followed up with workarounds or alternatives to address in a timely manner.
make sure you have media="print" for the CSS style sheet! Just spent ages looking at this pulling my hair out and was about to email WebSuperGoo then that thought came to me.
just about to back out all the changes I've made to my code and test again but it looks like with EngineType.Gecko it needs to be media="print" where as with EngineType.MSHtml it can be media="screen".....
very odd but hope that helps someone!
Make sure that the CSS is an absolute URL rather than relative, or add a base tag to the header of the HTML
For example, rather than
<style type="text/css" href="/styles/somecss.css" rel="stylesheet" />
use
<style type="text/css" href="http://myserver.com/styles/somecss.css" rel="stylesheet" />
Also if you site is SSL or authenticated then you will have to either make the area with the stylesheet un-authenticated, or, set the password and username attributes of the PDF object so that ABCPdf can authenticate
You can try the following in version 9
doc.HtmlOptions.PageLoadMethod =
PageLoadMethodType.WebBrowserNavigate;
I am using Version 10 of ABCpdf and I found that the style sheet path should be absolute instead of relative.
I changed the stylesheet path from "C:\MyProject\Resources\Styles.css" to "http:\www.MyDomain.com\Resources\Styles.css" and it worked.
Although, version 6 seems to be working with relative paths. I didnot check it with other versions
As per WebSuperGoo support:
(Query # : 6.17)
HTML does not exist within a file and so it does not have a location.
External stylesheets and images are often referenced via relative URLs. Because the HTML has no location it is impossible to resolve
these relative references.
So you need to provide your stylesheet and image links as absolute references. Or you may be able to use the HTML BASE element to specify
an appropriate base location. Or you can save your HTML to file in an
appropriate location and then use AddImageUrl.
Have you tried;
theDoc.HtmlOptions.DoMarkup = true;
This forces the engine to process the HTML before rendering.

Resources