template lang files with ## active ## tag are not activated if the file has a unicode BOM

RESOLVED FIXED

Status

www.mozilla.org
Bedrock
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: pascalc, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: u=dev c=l10n p=)

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
If the lang file is an UTF8 file with a BOM (which can happen since we have contributors using Windows), the 'active' tag is not detected because there is an invisible character before the end of the string and the following code fails to match:

if firstline.startswith('## active ##'):
    is_active = True

We should just filter out BOM as we did on the PHP site:
http://viewvc.svn.mozilla.org/vc/projects/mozilla.com/trunk/includes/l10n_moz.class.php?revision=97629&view=markup#l81
(Reporter)

Comment 1

5 years ago
Created attachment 693834 [details]
Pointer to Github pull request: https://github.com/mozilla/bedrock/pull/543

Pointer to Github pull-request

Updated

5 years ago
Whiteboard: u=dev c=l10n p=

Comment 2

5 years ago
Commits pushed to master at https://github.com/mozilla/bedrock

https://github.com/mozilla/bedrock/commit/04e2abe282d1ee15257628777933d916db2e2c7d
Bug 823024 - template lang files with ## active ## tag are not activated if the file has a unicode BOM

https://github.com/mozilla/bedrock/commit/acc9a55e0cd73293bf9f56d9d9c9ada119717edc
Merge pull request #543 from pascalchevrel/Bug-8823024-langfiles-removeBOM

Bug 823024 - template lang files with ## active ## tag are not activated...
(Reporter)

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.