-
Notifications
You must be signed in to change notification settings - Fork 24
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
[DO NOT MERGE] changes to accept i18Nlabels as input #397
base: main
Are you sure you want to change the base?
Conversation
@RAJESH-GN Fix the build, please. |
@tcorral fixed the tests. Can u please validate it once u have some time. |
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.
We have to discuss it further as I see many different things that we should align across implementations.
> | ||
Skip to Content | ||
{{ this.translations['app.skipToContent'] }} |
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.
I don't think the 'this.' is needed here as it's not needed in line '16'.
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.
Where the 'app.skipToContent' comes from? I have checked out the branch and I cannot find it, just the usage?
Also in my case I kept the original custom id and in this change it's changed to use camel case instead of using snake-case? Can you get it aligned, please?
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.translations['app.skipToContent'] }} | |
{{ this.translations['skip-to-content'] }} |
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.
done
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.
thanks was my bad
accessibility feature to quickly navigate to the main content section. | ||
This aria-label is located in the topbar area of the | ||
layout.@@move-focus-to-beginning-of-content" | ||
[attr.aria-label]="translations['move-focus-to-beginning-of-content']" |
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.
After the discussion on my PR about using [attr.aria-label]
I investigated a bit more and in this case using [ariaLabel]
is allowed because this property actually exist in the button
tag and Angular transforms it properly to 'aria-label' property in the HTML. Can you get it aligned, please?
[attr.aria-label]="translations['move-focus-to-beginning-of-content']" | |
[ariaLabel]="translations['move-focus-to-beginning-of-content']" |
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.
done
as an accessibility feature to indicate the button's function. This | ||
aria-label is located in the topbar area of the | ||
layout.@@bb-layout.sidebar_toggler" | ||
[attr.aria-label]="translations['bb-layout.sidebar_toggler']" |
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.
After the discussion on my PR about using [attr.aria-label] I investigated a bit more and in this case using [ariaLabel] is allowed because this property actually exist in the button tag and Angular transforms it properly to 'aria-label' property in the HTML. Can you get it aligned, please?
[attr.aria-label]="translations['bb-layout.sidebar_toggler']" | |
[ariaLabel]="translations['bb-layout.sidebar_toggler']" |
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.
done
as an accessibility feature to indicate the button's function. This | ||
aria-label is located in the topbar area of the | ||
layout.@@bb-layout.sidebar_toggler" | ||
[attr.aria-label]="translations['bb-layout.sidebar_toggler']" | ||
[attr.aria-expanded]="layoutService.navigationExpanded$ | async" |
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.
After the discussion on my PR about using [attr.aria-label] I investigated a bit more and in this case using [ariaExpanded] is allowed because this property actually exist in the button tag and Angular transforms it properly to 'aria-label' property in the HTML. Can you get it aligned, please?
[attr.aria-expanded]="layoutService.navigationExpanded$ | async" | |
[ariaExpanded]="layoutService.navigationExpanded$ | async" |
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.
done thomas thanks
@@ -8,6 +8,10 @@ import { | |||
} from '@backbase/foundation-ang/observability'; | |||
import { environment } from '../environments/environment'; | |||
|
|||
export interface Translations { |
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.
In my code and after a few iterations I have found that having a catalog with the translations might be more easy to debug and find changes but I also noticed that using Translations
every where will be a mess because in order for the developers to overwrite the translations for each journey or component we will need to export the translations and it has more sense to have it's own name like I have in the suggestion.
export interface Translations { | |
export interface AppTranslations { |
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.
done
import { ActivatedRoute, Router, RouterModule } from '@angular/router'; | ||
import { PERMISSIONS } from '@backbase-gsa/ach-positive-pay-journey/internal/shared-data'; | ||
import { HeadingModule } from '@backbase/ui-ang/heading'; | ||
|
||
export interface Translations { | ||
[key: string]: string; |
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.
Same reason that for my previous similar comments.
[key: string]: string; | |
'ach-positive-pay-journey.heading.title': string; | |
'ach-positive-pay-journey.heading.new-blocker.button': string; | |
[key: string]: string; |
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.
applied the change
@@ -11,11 +15,31 @@ import { HeadingModule } from '@backbase/ui-ang/heading'; | |||
}) | |||
export class AchPositivePayJourneyComponent { | |||
permissions = PERMISSIONS; | |||
@Input() | |||
public readonly translations: Translations = {}; |
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.
public readonly translations: Translations = {}; | |
public readonly translations: AchPositivePayJourneyTranslations = {}; |
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.
updated
@Input() | ||
public readonly translations: Translations = {}; | ||
|
||
public readonly defaultTranslations: Translations = { |
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.
public readonly defaultTranslations: Translations = { | |
public readonly defaultTranslations: AchPositivePayJourneyTranslations = { |
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.
changed
@@ -17,6 +21,74 @@ export class AppComponent { | |||
triplets = triplets; | |||
isAuthenticated = false; | |||
|
|||
public readonly translations: Translations = { |
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.
As we don't know if the user would like to override one or more or all of them we have to use Partial<>
public readonly translations: Translations = { | |
public readonly translations: Partial<AchPositivePayJourneyTranslations> = { |
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.
we dont need to use partials now i have made a new commit to address this issue please check
) { | ||
this.translations = { | ||
...this.defaultTranslations, | ||
...this.translations, |
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.
I am not sure if this might work after using Partial<>
after setting a more strict interface can you test?
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.
Sure tomas i will try different approach
> | ||
Skip to Content | ||
{{ appTranslations['skipToContent'] }} | ||
</button> | ||
|
||
<!-- Hamburger --> | ||
<button |
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.
It's a problem with this button because on running the accesibility linter it asks to have a text for the button. In my case I added the following code after the line 29.
<span class="sr-only">{{
translations['bb-layout.sidebar_toggler']
}}</span>
In your code it should be something like:
<span class="sr-only">{{
appTranslations['bb-layout.sidebar_toggler']
}}</span>
For this to work you also will need to add a class on the scss
file:
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
If you don't do this, the e2e tests will fail
No description provided.