Skip to content

Commit

Permalink
reorganize accessibility translation keys
Browse files Browse the repository at this point in the history
Signed-off-by: Prince Mendiratta <[email protected]>
  • Loading branch information
Prince-Mendiratta committed Mar 27, 2023
1 parent ddabb59 commit f8f848e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ export default {
fabNewChat: 'New chat (Floating action)',
chatPinned: 'Chat pinned',
draftedMessage: 'Drafted message',
listOfChatMessages: 'List of chat messages',
listOfChats: 'List of chats',
},
iou: {
amount: 'Amount',
Expand Down Expand Up @@ -608,6 +610,7 @@ export default {
invalidFormatEmailLogin: 'The email entered is invalid. Please fix the format and try again.',
},
cannotGetAccountDetails: 'Couldn\'t retrieve account details, please try to sign in again.',
loginForm: 'Login form',
},
personalDetails: {
error: {
Expand Down Expand Up @@ -1205,14 +1208,11 @@ export default {
allCountries: CONST.ALL_COUNTRIES,
accessibilityHints: {
navigateToChatsList: 'Navigate back to chats list',
listOfChatMessages: 'List of chat messages',
chatWelcomeMessage: 'Chat welcome message',
navigatesToChat: 'Navigates to a chat',
newMessageLineIndicator: 'New message line indicator',
chatMessage: 'Chat message',
lastChatMessagePreview: 'Last chat message preview',
loginForm: 'Login form',
listOfChats: 'List of chats',
workspaceName: 'Workspace name',
chatUserDisplayNames: 'Chat user display names',
scrollToNewestMessages: 'Scroll to newest messages',
Expand Down
6 changes: 3 additions & 3 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ export default {
fabNewChat: 'Nuevo chat',
chatPinned: 'Chat fijado',
draftedMessage: 'Mensaje borrador',
listOfChatMessages: 'Lista de mensajes del chat',
listOfChats: 'lista de chats',
},
iou: {
amount: 'Importe',
Expand Down Expand Up @@ -607,6 +609,7 @@ export default {
invalidFormatEmailLogin: 'El email introducido no es válido. Corrígelo e inténtalo de nuevo.',
},
cannotGetAccountDetails: 'No se pudieron cargar los detalles de tu cuenta, por favor intenta iniciar sesión de nuevo.',
loginForm: 'Formulario de inicio de sesión',
},
personalDetails: {
error: {
Expand Down Expand Up @@ -1671,14 +1674,11 @@ export default {
},
accessibilityHints: {
navigateToChatsList: 'Vuelve a la lista de chats',
listOfChatMessages: 'Lista de mensajes del chat',
chatWelcomeMessage: 'Mensaje de bienvenida al chat',
navigatesToChat: 'Navega a un chat',
newMessageLineIndicator: 'Indicador de nueva línea de mensaje',
chatMessage: 'mensaje de chat',
lastChatMessagePreview: 'Vista previa del último mensaje del chat',
loginForm: 'Formulario de inicio de sesión',
listOfChats: 'lista de chats',
workspaceName: 'Nombre del espacio de trabajo',
chatUserDisplayNames: 'Nombres de los usuarios del chat',
scrollToNewestMessages: 'Desplázate a los mensajes más recientes',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class ReportActionsList extends React.Component {
return (
<Animated.View style={[StyleUtils.fade(this.state.fadeInAnimation), styles.flex1]}>
<InvertedFlatList
accessibilityLabel={this.props.translate('accessibilityHints.listOfChatMessages')}
accessibilityLabel={this.props.translate('sidebarScreen.listOfChatMessages')}
ref={ReportScrollManager.flatListRef}
data={this.props.sortedReportActions}
renderItem={this.renderItem}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/sidebar/SidebarLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class SidebarLinks extends React.Component {
return (
<View
accessibilityElementsHidden={this.props.isSmallScreenWidth && !this.props.isDrawerOpen}
accessibilityLabel={this.props.translate('accessibilityHints.listOfChats')}
accessibilityLabel={this.props.translate('sidebarScreen.listOfChats')}
style={[styles.flex1, styles.h100]}
>
<View
Expand Down
2 changes: 1 addition & 1 deletion src/pages/signin/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class LoginForm extends React.Component {
const serverErrorText = ErrorUtils.getLatestErrorMessage(this.props.account);
return (
<>
<View accessibilityLabel={this.props.translate('accessibilityHints.loginForm')} style={[styles.mt3]}>
<View accessibilityLabel={this.props.translate('loginForm.loginForm')} style={[styles.mt3]}>
<TextInput
ref={el => this.input = el}
label={this.props.translate('loginForm.phoneOrEmail')}
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/UnreadIndicatorsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ beforeAll(() => {
});

function scrollUpToRevealNewMessagesBadge() {
const hintText = Localize.translateLocal('accessibilityHints.listOfChatMessages');
const hintText = Localize.translateLocal('sidebarScreen.listOfChatMessages');
fireEvent.scroll(screen.queryByLabelText(hintText), {
nativeEvent: {
contentOffset: {
Expand Down Expand Up @@ -106,7 +106,7 @@ function navigateToSidebarOption(index) {
* @return {Boolean}
*/
function isDrawerOpen() {
const hintText = Localize.translateLocal('accessibilityHints.listOfChats');
const hintText = Localize.translateLocal('sidebarScreen.listOfChats');
const sidebarLinks = screen.queryAllByLabelText(hintText);
return !lodashGet(sidebarLinks, [0, 'props', 'accessibilityElementsHidden']);
}
Expand All @@ -132,7 +132,7 @@ function signInAndGetAppWithUnreadChat() {
render(<App />);
return waitForPromisesToResolveWithAct()
.then(() => {
const hintText = Localize.translateLocal('accessibilityHints.loginForm');
const hintText = Localize.translateLocal('loginForm.loginForm');
const loginForm = screen.queryAllByLabelText(hintText);
expect(loginForm).toHaveLength(1);

Expand Down Expand Up @@ -208,7 +208,7 @@ describe('Unread Indicators', () => {
expect(LocalNotification.showCommentNotification.mock.calls).toHaveLength(0);

// Verify the sidebar links are rendered
const sidebarLinksHintText = Localize.translateLocal('accessibilityHints.listOfChats');
const sidebarLinksHintText = Localize.translateLocal('sidebarScreen.listOfChats');
const sidebarLinks = screen.queryAllByLabelText(sidebarLinksHintText);
expect(sidebarLinks).toHaveLength(1);
expect(isDrawerOpen()).toBe(true);
Expand Down

0 comments on commit f8f848e

Please sign in to comment.