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

[i18n] Optimize translation labels for Roles page #26945

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions x-pack/plugins/security/public/views/management/roles.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,15 @@
<div
class="kuiNoItems"
>
<span
i18n-id="xpack.security.management.roles.noFoundMatchingRolesDescription1"
i18n-default-message="No "
i18n-context="Part of composite label xpack.security.management.roles.noFoundMatchingRolesDescription1 + {matchingText} + xpack.security.management.roles.noFoundMatchingRolesDescription2"
></span>
<span
ng-show="query"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshdover, is there any rule according to usage of ng-show/ ng-if in Kibana? I left ng-show here, but I know that sometimes it's preferable to use ng-if to remove an element from the DOM.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we have a rule, but there are some cases where ngIf doesn't work correctly. If you can test that ngIf would work right in this case, then I think it'd be preferable to use that so that this tag doesn't get picked up by screenreaders.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I've checked with ng-if, it works as excepted.

i18n-id="xpack.security.management.roles.matchingText"
i18n-default-message="matching"
i18n-id="xpack.security.management.roles.noMatchingResultsLabel"
i18n-default-message="No matching roles found"
></span>
<span
i18n-id="xpack.security.management.roles.noFoundMatchingRolesDescription2"
i18n-default-message=" roles found"
ng-show="!query"
i18n-id="xpack.security.management.roles.noResultsLabel"
i18n-default-message="No roles found"
></span>
</div>
</div>
Expand Down