-
Notifications
You must be signed in to change notification settings - Fork 76
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
[l10n] Auto-mark strings for translation #677
Conversation
<p> | ||
Use the <Link to={Paths.repositories}>Repository Management</Link>{' '} | ||
Use the{' '} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need more love as a whole :)
<Main> | ||
<section className='body pf-c-content'> | ||
<h2>API token</h2> | ||
<h2>{_`API token`}</h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need moore love as a whole :)
Notes: |
4165d0c
to
86f7819
Compare
@ZitaNemeckova I've added a commit dealing with Might be ready :) |
Rebased, ready again :) |
src/containers/execution-environment-detail/tag-manifest-modal.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except 3 Enter
s LGTM 👍
…r<<' randomly in paths.ts because that's the only place which needs it at runtime (namespaceBreadcrumb) (and something is putting lodash in window._) use localStorage.test_l10n to enable marked strings
not *really* needed, but makes it easier to spot l10n if we don't use the underscore for other things
perl -i -npe 's/(?<!_)`[A-Z][^`]*`/_$&/' src/**/*.*
perl -i -npe s/=\''([A-Z][-a-zA-Z0-9_,. ]*)'\'/'={_`$1`}'/g src/**/*.*
perl -i -npe s/\''([A-Z][-a-zA-Z0-9_,. ]+)'\''(?!:)/_`$1`'/g src/**/*.*
perl -i -npe s/=\''([A-Z][-a-zA-Z0-9_,.:?!@$%\[\]<> ]+)'\''/={_`$1`}'/g src/**/*.* perl -i -npe s/\''([A-Z][-a-zA-Z0-9_,.:?!@$%\[\]<> ]+)'\''(?!:)/_`$1`'/g src/**/*.*
perl -i -npe 's/="([A-Z][-a-zA-Z0-9_,.:?!@$%\[\]<> '\'']+)"/={_`$1`}/g' src/**/*.* perl -i -npe 's/"([A-Z][-a-zA-Z0-9_,.:?!@$%\[\]<> '\'']+)"(?!:)/_`$1`/g' src/**/*.*
perl -i -npe 's/>([A-Z][-a-zA-Z0-9_,.:?!@$%\[\] '\'']+)</>{_`$1`}</g' src/**/*.*
perl -i -npe 's/^(\s{4,})([A-Z][-a-zA-Z0-9_,.:?!@$%\[\] '\'']+)(\s*)$/$1\{_`$2`}$3/g unless /,\s*$/' src/**/*.* (with a manual fixup for 1 syntax error)
Fixes AAH-800
This PR:
n_
) or non-translating (N_
) yet, just the basic versionTo achieve the first, this adds a simple
_
JS string template that either behaves as regular template string, or, whenlocalStorage.test_l10n = true
is set (+reload), marks every translatable string in french quotes...The latter was just a series of perl invocations to convert anything that looks like a human string,
only strings starting with a capital letter could safely be converted in some cases,
multiline strings and strings with params are not quite possible to do with regex without some major preprocessing.
(Adding lingui itself in a separate PR, there are still problems with macros and typescript.) (AAH-803)
(Guidelines re pluralization, params coming also separately (AAH-802)
Review: please tell me about any string that's marked incorrectly or shouldn't be marked at all
(If you see a string that should be marked and isn't, just fix it outside of this PR, this should add the bulk of the changes, so we can then finish the rest manually.)