Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Move string.xml html to CDATA #3185

Closed
keianhzo opened this issue Apr 17, 2020 · 8 comments
Closed

Move string.xml html to CDATA #3185

keianhzo opened this issue Apr 17, 2020 · 8 comments
Assignees
Labels
ARCHIVED CLOSED at time of archiving in progress
Milestone

Comments

@keianhzo
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Per @flodolo's comment seem like using CDATA plays better with the localization flow that using encoded xml entities. We should look into migrating those.

Describe the solution you'd like
Migrate XML entities containing strings like:

<string name="security_options_drm_content_v1">Automatically allow sites to identify your device to play DRM-controlled content. (&lt;a href="%1$s">Learn More&lt;/a>)</string>

to CDATA based:

<string name="private_browsing_body"><![CDATA[
<p>When you browse in a Private Window, %1$s <strong>does not save</strong>:</p>
<ul class="two-column">
<li>visited pages</li>
<li>searches</li>
<li>cookies</li>
<li>temporary files</li>
</ul>
<p>Private Browsing <strong>doesn’t make you anonymous</strong> on the Internet. Your employer or Internet service provider can still know what page you visit.</p>
<p class="about-info">Learn more about <a id="learnMore">Private Browsing</a>.</p>
]]></string>

@flodolo
Copy link

flodolo commented Apr 17, 2020

@Pike
In this case, it would be great to manually fix the existing translations if possible. Would that create any issue with the automation, besides the risk of conflicts?

@Pike
Copy link
Contributor

Pike commented Apr 17, 2020

I think that should be OK. Note, if Pontoon saved those entities, it'd also update the CDATA formatting, so maybe that's the route of least trouble.

@flodolo
Copy link

flodolo commented Apr 17, 2020

Note, if Pontoon saved those entities, it'd also update the CDATA formatting, so maybe that's the route of least trouble.

Can you clarify this part? I wouldn't expect the source string to match the previous version, unless the CDATA is ignored by Pontoon.

Also, can this be actually tested in some ways? I'd prefer not to rely on a "maybe", because it bit us in the past ;-)

@Pike
Copy link
Contributor

Pike commented Apr 17, 2020

I expect the source string in Pontoon to be exactly the same, the translations, too. This is all done in parser magic, https://github.com/Pike/compare-locales/blob/b48ca021edf5b0b8a7f8837ad104c540b4024b0a/compare_locales/parser/android.py#L155-L167 effectively.

Sadly to use Pontoon, we'd need to fake ChangedEntity, I guess. Using compare-locales' serializer directly with new values being old values should do the same trick.

All untested, just theory.

@emstanley emstanley added this to the #11 polish milestone Apr 20, 2020
@keianhzo
Copy link
Contributor Author

@flodolo My plan was to migrate all the encoded XML entieies to CDATA and update the strings keys. Is that the way to go? I'm confused after your conversation above.

@flodolo
Copy link

flodolo commented Jun 18, 2020

I think that's more a question for @Pike at this point, and we potentially need to involve @mathjazz

@keianhzo
Copy link
Contributor Author

@Pike @mathjazz Any updates?

@Pike
Copy link
Contributor

Pike commented Jun 23, 2020

There shouldn't be key changes as long as it's just the encoding and CDATA.

@keianhzo keianhzo self-assigned this Jun 23, 2020
@bluemarvin bluemarvin modified the milestones: #11 polish, #12 features Jun 29, 2020
@cknowles-admin cknowles-admin added the ARCHIVED CLOSED at time of archiving label Jul 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ARCHIVED CLOSED at time of archiving in progress
Projects
None yet
Development

No branches or pull requests

6 participants