Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
rename files
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoevanp committed Oct 27, 2021
1 parent 7883640 commit 2c04187
Show file tree
Hide file tree
Showing 16 changed files with 6 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"choose_a_department_1": "Choose a department",
"choose_an_option": "Choose an option...",
"conversation_finished": "Chat encerrado",
"count_new_messages_since_since_one": "One new message since {{since}}",
"count_new_messages_since_since_other": "{{count}} new messages since {{since}}",
"count_new_messages_since_since_one": "Uma nova mensagem desde {{since}}",
"count_new_messages_since_since_other": "{{count}} novas mensagens desde {{since}}",
"department_switched": "Departamento comutado",
"departments": "Departments",
"disable_notifications": "Disable notifications",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions src/i18next.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default i18next
.init({
lng: normalizeLanguageString(configLanguage() || browserLanguage()),
fallbackLng: 'en',
debug: true,
react: {
useSuspense: false,
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const normalizeLanguageString = (languageString) => {
countryCode = countryCode.toUpperCase();
}

return countryCode ? `${ languageCode }_${ countryCode }` : languageCode;
return countryCode ? `${ languageCode }-${ countryCode }` : languageCode;
};

/**
Expand Down
3 changes: 2 additions & 1 deletion src/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const loadConfig = async () => {

export const processUnread = async () => {
const { minimized, visible, messages } = store.state;
console.log(i18next);
if (minimized || !visible) {
const { alerts, lastReadMessageId } = store.state;
const renderedMessages = messages.filter((message) => canRenderMessage(message));
Expand All @@ -48,7 +49,7 @@ export const processUnread = async () => {

if (lastReadMessageIndex !== -1) {
const lastReadMessage = renderedMessages[lastReadMessageIndex];
const alertMessage = i18next.t('count_new_messages_since_since', { count: unreadMessages, since: format(parseISO(lastReadMessage.ts), 'HH:mm MMM dd') });
const alertMessage = i18next.t('count_new_messages_since_since', { count: unreadMessages.length, since: format(parseISO(lastReadMessage.ts), 'HH:mm MMM dd') });
const alert = { id: constants.unreadMessagesAlertId, children: alertMessage, success: true, timeout: 0 };
const newAlerts = alerts.filter((item) => item.id !== constants.unreadMessagesAlertId);
await store.setState({ alerts: (newAlerts.push(alert), newAlerts) });
Expand Down

0 comments on commit 2c04187

Please sign in to comment.