Open Bug 1540186 Opened 6 years ago Updated 2 years ago

default_locale not working when creating a dictionary extension

Categories

(WebExtensions :: General, enhancement, P5)

66 Branch
enhancement

Tracking

(firefox66 affected)

Tracking Status
firefox66 --- affected

People

(Reporter: tacchan666, Unassigned)

Details

Attachments

(1 file)

123.07 KB, application/x-zip-compressed
Details
Attached file attachments.zip

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0

Steps to reproduce:

I've justed ported my dictionary add-on with the new WebExtension and I'm facing a problem. In the old format (install.rdf) I can specify different name and description for each language, like this:

< em:localized > < Description > < em:locale >en< /em:locale > < em:name >name< /em:name > < em:description >description< /em:description > < /Description > < Description > < em:locale >it< /em:locale > < em:name >nome< /em:name > < em:description >descrizione< /em:description > < /Description > ...

Now (manifest.json) I see there is only one pair of name-discription, like this:

{

"name": "name",
"description": "description",

...

The problem is that I didn't find a way to specify the name-description pair for other languages. Trying

{

"name": "MSG_extensionName",
"description": "MSG_extensionDescription",
"default_locale": "it",

... with the usual locales structure (_locales/{lang}/manifest.json) { "application_title": { "message": "name" }, "application_description": { "message": "description" } }

didn't work because when I upload my extension the AMO complains about non valid tag "default_locale". What am I doing wrong?

Actual results:

I cannot specify a different name and description for each language.

Expected results:

I should be able to specify different name and description for each language as per pre-WebExtension times.

Component: Untriaged → General
Product: Firefox → WebExtensions
Priority: -- → P5

I'm not able to reproduce this issue using Win7x64 on FF68.0a1 (2019-04-03), FF67.0b7 and FF66.0.2.
I have used (1) as a test webextensions and installed it on a En-us build and a FR build and the name appeared correctly for each localization.
Also using (1) I am able to submit it to AMO and the validation is passing.

Can you try following the directions from this pages (2) and (3)? If the problem is still reproducing can you please add a comment with the error you are receiving, and also add the extension you are using to reproduce this issue? That will help us debug your issue.

(1) - https://github.com/mdn/webextensions-examples/tree/master/notify-link-clicks-i18n
(2) - https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Internationalization
(3) - https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n/Locale-Specific_Message_reference

Flags: needinfo?(tacchan666)

I've tried following (1) but without success: same error as reported in the original attachments.zip.

Your add-on failed validation with 2 errors.
"/default_locale" is an invalid additional property
"/icons" is an invalid additional property

manifest.json:

{
	"name": "__MSG_extensionName__",
	"description": "__MSG_extensionDescription__",
	"version": "2.2.3.1",

	"manifest_version": 2,
	"author": "Màuro Trevixan",
	"homepage_url": "https://parnodesmentegar.wordpress.com",
	"dictionaries": {
		"vec": "dictionaries/venetan.dic"
	},
	"browser_specific_settings": {
		"gecko": {
			"id": "vec@dictionaries.addons.mozilla.org"
		}
	},
	"default_locale": "vec",
	"icons": {
		"200": "images/veneto.png"
	}
}

messages.json:

{
	"extensionName": {
		"message": "Diŧionario de lengua vèneta",
		"description": "Diŧionario de lengua vèneta doparando la grafía de Màuro Trevixan (2019-01-27)."
	},
	"extensionDescription": {
		"message": "Diŧionario de lengua vèneta",
		"description": "Diŧionario de lengua vèneta doparando la grafía de Màuro Trevixan (2019-01-27)."
	}
}

As a side note, previous messages.json was:

{
	"application_title": {
		"message": "Diŧionario de lengua vèneta"
	},
	"application_description": {
		"message": "Diŧionario de lengua vèneta doparando la grafía de Màuro Trevixan (2019-01-27)."
	}
}

My file structure is:

_locales
dictionaries
images
manifest.json

I don't understand how could it works for you

Flags: needinfo?(tacchan666)

Comment 1 appears to be about an extension, while this bug is about dictionaries.
No need to confirm this though, its true that dictionaries don't currently support default_locale

Status: UNCONFIRMED → NEW
Type: defect → enhancement
Ever confirmed: true

Thank you Andrew.
How could it be that the new WebExtension is not supporting what was already supported before?
In the past the install.rdf file supported different localizations, if I remember well.

<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
	<Description about="urn:mozilla:install-manifest">
		<!-- https://developer.mozilla.org/en-US/Add-ons/Install_Manifests -->
		<em:id>vec@dictionaries.addons.mozilla.org</em:id>
		<em:type>64</em:type>
		<em:unpack>true</em:unpack>
		<em:version>2.2.2</em:version>
		<em:name>Diŧionario de lengua vèneta - Dizionario di lingua veneta</em:name>
		<em:description>Diŧionario de lengua vèneta doparando la grafía de Màuro Trevixan (2019-01-27)</em:description>
		<em:creator>Màuro Trevixan</em:creator>
		<em:homepageURL>https://parnodesmentegar.wordpress.com</em:homepageURL>
		<em:localized>
			<Description>
				<em:locale>en</em:locale>
				<em:name>Venetan spell-checking dictionary</em:name>
				<em:description>Venetan dicionary using the spelling of Mauro Trevisan (2019-01-27).</em:description>
			</Description>
			<Description>
				<em:locale>vec</em:locale>
				<em:name>Diŧionario de lengua vèneta</em:name>
				<em:description>Diŧionario de lengua vèneta doparando la grafía de Màuro Trevixan (2019-01-27).</em:description>
			</Description>
			<Description>
				<em:locale>it</em:locale>
				<em:name>Correttore ortografico per la lingua veneta</em:name>
				<em:description>Dizionario di lingua veneta usando la grafia di Mauro Trevisan (2019-01-27).</em:description>
			</Description>
			<Description>
				<em:locale>es</em:locale>
				<em:name>Diccionario de ortografía Venetan</em:name>
				<em:description>Diccionario venetano utilizando la ortografía de Mauro Trevisan (2019-01-27).</em:description>
			</Description>
			<Description>
				<em:locale>gl</em:locale>
				<em:name>Dicionario de verificación ortográfica Venetan</em:name>
				<em:description>Dicionario venetano usando a ortografía de Mauro Trevisan (2019-01-27).</em:description>
			</Description>
			<Description>
				<em:locale>pt</em:locale>
				<em:name>Dicionário de verificação ortográfica Venetan</em:name>
				<em:description>Dicionário veneto usando a grafia de Mauro Trevisan (2019-01-27).</em:description>
			</Description>
		</em:localized>
		<em:multiprocessCompatible>true</em:multiprocessCompatible>

		<!-- https://addons.mozilla.org/en-US/firefox/pages/appversions/ -->
		<!-- Firefox -->
		<em:targetApplication>
			<Description>
				<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
				<em:minVersion>18.0a1</em:minVersion>
				<em:maxVersion>70.0</em:maxVersion>
			</Description>
		</em:targetApplication>
		<!-- Thunderbird -->
		<em:targetApplication>
			<Description>
				<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
				<em:minVersion>18.0a1</em:minVersion>
				<em:maxVersion>63.0</em:maxVersion>
			</Description>
		</em:targetApplication>
		<!-- Firefox for Android -->
		<em:targetApplication>
			<Description>
				<em:id>{aa3c5121-dab2-40e2-81ca-7ea25febc110}</em:id>
				<em:minVersion>46.0</em:minVersion>
				<em:maxVersion>70.0</em:maxVersion>
			</Description>
		</em:targetApplication>
		<!-- Mobile -->
		<!-- <em:targetApplication>
			<Description>
				<em:id>{a23983c0-fd0e-11dc-95ff-0800200c9a66}</em:id>
				<em:minVersion>40.0</em:minVersion>
				<em:maxVersion>40.*</em:maxVersion>
			</Description>
		</em:targetApplication> -->
		<!-- SeaMonkey -->
		<em:targetApplication>
			<Description>
				<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
				<em:minVersion>2.15a1</em:minVersion>
				<em:maxVersion>2.60</em:maxVersion>
			</Description>
		</em:targetApplication>
	</Description>
</RDF>

(In reply to tacchan666 from comment #4)

How could it be that the new WebExtension is not supporting what was already supported before?
In the past the install.rdf file supported different localizations, if I remember well.

I may be misunderstanding your question but it was simply an oversight when the new format was implemented.

Ok, I understand. Do you know if there is a plan to fix this?

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: