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

Pre-migrate: simplify translations #455

Closed
hmpf opened this Issue Sep 2, 2016 · 9 comments

Comments

4 participants
@hmpf
Contributor

hmpf commented Sep 2, 2016

Ensure that there are no usage of t() that uses concatenation in the tag, or deprecated arguments. Use only two arguments: the $tag, which must be a string or a variable, and optional $replacements, which stays a key-value array.

@hmpf hmpf added this to the 1.15.0 milestone Sep 2, 2016

@hmpf

This comment has been minimized.

Contributor

hmpf commented Sep 5, 2016

Also ensure that absolutely all translations uses t() and nothing else.

@hmpf

This comment has been minimized.

Contributor

hmpf commented Sep 5, 2016

The following modules have templates with translations that needs simplifying:
x authorize
x authX509
x authYubiKey
x consentAdmin
x feide
x core
x saml
x discopower
x consent

(List not exhaustive)

@hmpf

This comment has been minimized.

Contributor

hmpf commented Sep 5, 2016

The following modules need no simplification:

  • expirycheck
  • negotiate

(List not exhaustive)

@hmpf

This comment has been minimized.

Contributor

hmpf commented Sep 6, 2016

The very worst modules to fix are:

  • consentAdmin
  • feide
  • consent
  • core
  • saml
  • discopower

In that order

@hmpf hmpf referenced this issue Sep 6, 2016

Closed

Simplify translation domains #466

1 of 3 tasks complete
@hmpf

This comment has been minimized.

Contributor

hmpf commented Sep 7, 2016

See the link for an attempt at an analysis of all existing usage of t(): Translation analysis
Translation analysis 08/2018

Format

Each line starts with the filename of a file the t()-usage was found in. If the same content is translated several times in a single file, there will be only one entry in the file.

After the filename comes what was found between the parentheses of the t():

An opening brace ({) on a line means the string is namespaced. Two colons after the brace means the domain has a subdomain. We don't want any subdomains.

, array near the end of a line means the translation has placeholders. If the array is followed by anything, the t() uses deprecated arguments. Get rid of the deprecated arguments.

. concat near the end of a line means the string is concatenated and not findable by an extractor. We don't want any of these!

$ right after the leftmost colon (which marks the end of the filename) means there is no string to translate, but a variable. We need a noop() version of the actual contents of the variable somewhere so that extractors can find it!

NL means the contents of the t() is spread over multiple lines. Do we want that?

The final possibility is only found in
modules/core/templates/frontpage_federation.tpl.php: translating the returned value from a function, in this case mtype. Let's move that mtype out of the template.
Was fixed in 580be5f

hmpf added a commit that referenced this issue Sep 15, 2016

hmpf added a commit that referenced this issue Sep 15, 2016

hmpf added a commit that referenced this issue Sep 15, 2016

Remove concat: translated tab-title
For #455. Note that if translation tags were domain-free strings, the
mapping from tab to tabtitle would be redundant. It would still be
necessary to mark the strings as noop however.

hmpf added a commit that referenced this issue Sep 15, 2016

hmpf added a commit that referenced this issue Sep 15, 2016

hmpf added a commit that referenced this issue Sep 16, 2016

@hmpf hmpf referenced this issue Sep 16, 2016

Closed

Errorcode class #474

hmpf added a commit that referenced this issue Sep 16, 2016

hmpf added a commit that referenced this issue Sep 16, 2016

@hmpf

This comment has been minimized.

Contributor

hmpf commented Oct 18, 2016

Keep subdomains for 1.15, switch to strings instead of tags for 2.0 which also solves the subdomain problem.

hmpf added a commit that referenced this issue Oct 27, 2016

hmpf added a commit that referenced this issue Oct 28, 2016

Namespace translation tags
Note the tags 'spname' and spdescription' that cannot be namespaced because
their translations are loaded dynamically.

For #455 and #465

precurse added a commit to precurse/simplesamlphp that referenced this issue Nov 10, 2016

precurse added a commit to precurse/simplesamlphp that referenced this issue Nov 10, 2016

Namespace translation tags
Note the tags 'spname' and spdescription' that cannot be namespaced because
their translations are loaded dynamically.

For simplesamlphp#455 and simplesamlphp#465

@jaimeperez jaimeperez modified the milestones: v1.16, 1.15.0 Aug 3, 2017

tvdijen added a commit to tvdijen/simplesamlphp that referenced this issue Aug 7, 2017

tvdijen added a commit to tvdijen/simplesamlphp that referenced this issue Aug 7, 2017

tvdijen added a commit to tvdijen/simplesamlphp that referenced this issue Aug 7, 2017

Remove concat: translated tab-title
For simplesamlphp#455. Note that if translation tags were domain-free strings, the
mapping from tab to tabtitle would be redundant. It would still be
necessary to mark the strings as noop however.

tvdijen added a commit to tvdijen/simplesamlphp that referenced this issue Aug 7, 2017

tvdijen added a commit to tvdijen/simplesamlphp that referenced this issue Aug 7, 2017

tvdijen added a commit to tvdijen/simplesamlphp that referenced this issue Aug 7, 2017

tvdijen added a commit to tvdijen/simplesamlphp that referenced this issue Aug 7, 2017

tvdijen added a commit to tvdijen/simplesamlphp that referenced this issue Aug 7, 2017

tvdijen added a commit to tvdijen/simplesamlphp that referenced this issue Aug 7, 2017

Namespace translation tags
Note the tags 'spname' and spdescription' that cannot be namespaced because
their translations are loaded dynamically.

For simplesamlphp#455 and simplesamlphp#465
@tvdijen

This comment has been minimized.

Member

tvdijen commented May 10, 2018

@hmpf Would it be possible to run another analysis on this? I asume you've scripted that before...
Right now it's kinda hard to see what's left to be done..

@hmpf

This comment has been minimized.

Contributor

hmpf commented May 24, 2018

It was pipes and unix tools and a lot of vimming and regular expressions so it'd take a while. Let's see, started by grepping for usage of t() and all its variants, then modified with several rounds of regexpes to only home in on the value to be translated. Grepping for '{ should also help.

Or, a script that worked through the existing analysis and checked if the right hand side were still there would catch quite a lot.

@thijskh thijskh modified the milestones: 1.16, 1.17 May 28, 2018

@tvdijen tvdijen modified the milestones: 1.17, 1.18 Oct 11, 2018

@thijskh

This comment has been minimized.

Member

thijskh commented Nov 20, 2018

Described cases not used anymore outside of old templates

@thijskh thijskh closed this Nov 20, 2018

@thijskh thijskh modified the milestones: 1.18, 1.17 Nov 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment