..except for top-level `const` for which we allow
camelCase, PascalCase and UPPER_CASE for the time being
to accomodate the status quo in DevTools FE.
Also allow `UIStrings` and `str_` which are used for localization
all over the place.
Bug: chromium:1057042
Change-Id: Ifa0445ac08c78997499ac5f9f33c9a9dc03d37fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2692779
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
As a drive-by, add a localized empty string constant so that
we can intialize class members with it, and so that we can avoid
having empty strings in multiple translation files as we do right
now.
Also rename the component_docs directory which still referred to
issues.
Bug: 1112738
Change-Id: I68bc11286e3b4c83f0a3bf4dbbcf1fb1932764b0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2643508
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
The LocalizedString type alias in UIString.js is a so-called
"branded type". A branded type alias allows us to construct
special types in type-casts and enforce that these specific
alias are used. The following properties hold:
1. A string can be force-casted into a LocalizedString
2. A LocalizedString can be enforced as argument type
3. A LocalizedString can be downcasted/used as regular string
4. A LocalizedString can normally not be concatenated, unless
force-casts are added (which is strongly discouraged, since
localization can be structure-dependent)
These properties are for example used to enforce that all titles
of the ViewRegistration declarations are localized strings. I have
manually verified that passing in a regular string will correctly
cause TypeScript to error.
The new i18n localization system uses the same force-cast to make
sure that the new localized strings also adhere to the same
structure.
As a result of this change, I discovered several inconsistencies
in how types were used. For example, strings were being passed
in and assumed to be localized, but not enforced. Therefore,
this CL contains several cleanups that require the LocalizedString
itself and hence have to be bundled in this CL.
R=petermarshall@chromium.org
Change-Id: I2faffde47069c900e2e5e7c0ebb460d0792d2935
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2612861
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>