Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "full" localization ids in the PDFDocumentProperties class #18663

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

  • Use "full" localization ids in the PDFDocumentProperties class

    It was recently brought to my attention that using partial or generated localization ids is bad for maintainability, which means that PR Introduce a helper method for fetching l10n-data in PDFDocumentProperties #18636 wasn't the correct thing to do.
    However, just reverting that one doesn't really fix the problems which is why this patch updates every l10n-id in the PDFDocumentProperties class (but doesn't touch any viewer.ftl-files). Obviously this leads to more verbose code, but that cannot really be helped.

  • Move the metric-locale check into PDFDocumentProperties.#parsePageSize

    With the introduction of Fluent the getLanguage-method became synchronous, hence it no longer seems necessary to do the metric-locale check eagerly in the constructor and it can instead be "delayed" until actually needed.

@Snuffleupagus Snuffleupagus changed the title Pdf document properties full l10n ids Use "full" localization ids in the PDFDocumentProperties class Aug 29, 2024
It was recently brought to my attention that using partial or generated localization ids is bad for maintainability, which means that PR 18636 wasn't the correct thing to do.
However, just reverting that one doesn't really fix the problems which is why this patch updates *every* l10n-id in the `PDFDocumentProperties` class (but doesn't touch any `viewer.ftl`-files). Obviously this leads to more verbose code, but that cannot really be helped.
With the introduction of Fluent the `getLanguage`-method became synchronous, hence it no longer seems necessary to do the metric-locale check eagerly in the constructor and it can instead be "delayed" until actually needed.
@Snuffleupagus Snuffleupagus force-pushed the PDFDocumentProperties-full-l10n-ids branch from 89a12ff to 39ac3ef Compare August 29, 2024 18:26
@Snuffleupagus Snuffleupagus marked this pull request as ready for review August 29, 2024 18:32
@timvandermeij
Copy link
Contributor

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/6bb090ef5bc9b11/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/6bb090ef5bc9b11/output.txt

Total script time: 1.10 mins

Published

@timvandermeij timvandermeij merged commit f6216df into mozilla:master Aug 29, 2024
6 checks passed
@timvandermeij
Copy link
Contributor

Looks good; thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants