Closed Bug 1032813 Opened 10 years ago Closed 9 years ago

[L10n][Contacts] Clean up mozL10n.get uses in Contacts app

Categories

(Firefox OS Graveyard :: Gaia::Contacts, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: mbudzynski, Assigned: ShellHacker, Mentored)

References

Details

(Whiteboard: [good first bug])

      No description provided.
Mentor: mbudzynski, gandalf
Whiteboard: [good first bug]
This is a Contacts follow up for meta Bug 1020138. As described there:

It's all about grepping for "mozL10n.get" use cases and if it's simple:

var text = navigator.mozL10n.get(l10nId);
node.textContent = text;

replacing it with:

node.setAttribute('data-l10n-id', l10nId);
Assignee: nobody → aksht.kedia
Flags: needinfo?(mbudzynski)
Hey,

I will like to work on this bug. Can you tell me which file/folder I need to grep ? 

Thanks.
Hi Akshat,

You can find contacts app in apps/communications/contacts. This bug is a little bit more than just grepping and replacing strings, it will need small changes in a logic as well (like every use of TAG_OPTIONS - this object is localized).
Flags: needinfo?(mbudzynski)
Can I be assigned to work on this ? Looks like Akshat's probably caught up.
Flags: needinfo?(aksht.kedia)
Can I be assigned to work on this ? Looks like Akshat's probably caught up.
Flags: needinfo?(mbudzynski)
Go ahead take it on.
Flags: needinfo?(aksht.kedia)
Thanks Akshat :+1:
Taking this bug to work on.
Assignee: aksht.kedia → sudheesh1995
(In reply to Michał Budzyński (:michalbe) from comment #1)

> var text = navigator.mozL10n.get(l10nId);
> node.textContent = text;
> 
> replacing it with:
> 
> node.setAttribute('data-l10n-id', l10nId);

In case its an underscore instead of text, should and the usage is just mozL10n.get; should the replacement be

node.setAttribute('data-l10n-id',''); ?
I think we will need to use the |translate| method, but not so sure, Michal what do you think?
Underscore & mozL10N.get() is the same function, we don't want to use it in the code anymore, instead we just set correct attributes on DOM nodes.
Flags: needinfo?(mbudzynski)
I am not clear about this, since the get(<param>) is translated to node.setAttribute('data-l10n-id','<param>'); , having no parameter, makes the param part be a null string ? ('') ?
There should be no place where we do mozL10n.get(''); That's a clear error, since the function cannot receive an empty l10n identifier.
So how should the var _ = mozL10n.get; be converted to, this is the problem that I am facing.
NI'ing
Closing as wontfix since this cleanup already happened.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.