Skip to content

Commit

Permalink
🔖Release/6.0.2 (#214)
Browse files Browse the repository at this point in the history
* FWF:3320 [feature] Added dynamic select language per tenant

* FWF:3320 [Feature] Upgraded version to 6.0.2

* ✨ Feature/FWF:3385 Spanish resource bundle updated to release/6.0.2 (#212)

* FWF:3385 [Feature] Added spanish resource bundle keys

* Added pull request template

* Update CHANGELOG.md

* Added Access denied translation (#218)

* Added missing translation (#219)

* Update CHANGELOG.md
  • Loading branch information
shuhaib-aot authored Jun 6, 2024
1 parent 59e24a0 commit c29a28d
Show file tree
Hide file tree
Showing 14 changed files with 486 additions and 24 deletions.
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Issue Tracking

JIRA:
Issue Type: BUG/ FEATURE

# Changes
<!--
What are the main changes in the PR?
Give a high-level description of the changes.
#Examples: Added a search feature, Renaming several fields, etc.
-->
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Mark items as `Added`, `Changed`, `Fixed`, `Modified`, `Removed`, `Untested Features`, `Upcoming Features`, `Known Issues`

## 6.0.2 - 2024-06-05

`Generic Changes`
* The tenant user's default language is set from their data, tenant data, or the default application language.
* Updated Spanish resource bundle

## 6.0.1 - 2024-05-16

`Added`
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v6.0.1
v6.0.2
2 changes: 1 addition & 1 deletion forms-flow-admin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@formsflow/admin",
"version": "6.0.1",
"version": "6.0.2",
"scripts": {
"start": "webpack serve",
"start:standalone": "webpack serve --env standalone",
Expand Down
2 changes: 1 addition & 1 deletion forms-flow-integration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@formsflow/integration",
"version": "6.0.1",
"version": "6.0.2",
"scripts": {
"start": "webpack serve",
"start:standalone": "webpack serve --env standalone",
Expand Down
28 changes: 18 additions & 10 deletions forms-flow-nav/src/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ const NavBar = React.memo(({ props }) => {
const isAuthenticated = instance?.isAuthenticated();
const { pathname } = location;
const [userDetail, setUserDetail] = React.useState({});
const [lang, setLang] = React.useState(userDetail?.locale);
const savedLanguage = localStorage.getItem("lang");
const [lang, setLang] = React.useState(savedLanguage);
const userRoles = JSON.parse(
StorageService.get(StorageService.User.USER_ROLE)
);
Expand Down Expand Up @@ -174,10 +175,11 @@ const NavBar = React.memo(({ props }) => {
}, []);

useEffect(() => {
const language = lang ? lang : LANGUAGE;
props.publish("ES_CHANGE_LANGUAGE", language);
i18n.changeLanguage(language);
localStorage.setItem("lang", language);
if(lang){
props.publish("ES_CHANGE_LANGUAGE", lang);
i18n.changeLanguage(lang);
localStorage.setItem("lang", lang);
}
}, [lang]);

React.useEffect(() => {
Expand All @@ -186,12 +188,18 @@ const NavBar = React.memo(({ props }) => {
);
}, [instance]);

/**
* Fetches the user's locale from the instance or tenant data, and sets the lang state variable accordingly.
* This effect runs whenever the instance or tenant data changes.
*/
React.useEffect(() => {
if (!lang) {
const locale = instance?.getUserData()?.locale;
setLang(locale);
}
}, [instance]);
const locale =
instance?.getUserData()?.locale ||
tenant?.tenantData?.details?.locale ||
lang ||
LANGUAGE;
setLang(locale);
}, [instance, tenant.tenantData]);

const handleOnclick = (selectedLang) => {
setLang(selectedLang);
Expand Down
9 changes: 8 additions & 1 deletion forms-flow-service/src/resourceBundles/bg/resourceBundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,5 +651,12 @@ export const RESOURCE_BUNDLES_BG = {
"Learn more about the feature": "Научете повече за функцията",
"Native Integrations Pro": "Нативни Интеграции Про",
" team.": "екип.",
"Connect with formsflow.ai team.": "Свържете се с екипа на formsflow.ai."
"Connect with formsflow.ai team.": "Свържете се с екипа на formsflow.ai.",
"Proceed to Sign In": "Продължете към Вход",
"Contact formsflow.ai support": "Свържете се с поддръжката на formsflow.ai",
"Please provide your tenant name to sign in": "Моля, предоставете името на вашата аренда, за да влезете",
"Tenant not found":"Наемателят не е намерен",
"You don't have permission to access this page.": "Нямате разрешение за достъп до тази страница.",
"Please contact your administrator or try again later.": "Моля, свържете се с вашия администратор или опитайте по-късно.",
"Return to login": "Върнете се към вход"
};
9 changes: 8 additions & 1 deletion forms-flow-service/src/resourceBundles/de/resourceBundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,5 +655,12 @@ export const RESOURCE_BUNDLES_DE = {
"team for requests or queries.": "das Team für Anfragen oder Fragen.",
"Learn more about the feature": "Erfahren Sie mehr über das Feature",
" team.": "Team.",
"Connect with formsflow.ai team.": "Verbinden Sie sich mit dem formsflow.ai-Team."
"Connect with formsflow.ai team.": "Verbinden Sie sich mit dem formsflow.ai-Team.",
"Proceed to Sign In": "Weiter zur Anmeldung",
"Contact formsflow.ai support": "Kontaktieren Sie den Support von formsflow.ai",
"Please provide your tenant name to sign in": "Bitte geben Sie Ihren Mandantenname zum Anmelden ein",
"Tenant not found":"Mandant nicht gefunden",
"You don't have permission to access this page.": "Sie haben keine Berechtigung, diese Seite zu betreten.",
"Please contact your administrator or try again later.": "Bitte wenden Sie sich an Ihren Administrator oder versuchen Sie es später erneut.",
"Return to login": "Zurück zum Login"
};
9 changes: 8 additions & 1 deletion forms-flow-service/src/resourceBundles/en/resourceBundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,14 @@ export const RESOURCE_BUNDLES_EN = {
"team for requests or queries.": "team for requests or queries.",
"Learn more about the feature": "Learn more about the feature",
" team.": "team.",
"Connect with formsflow.ai team.": "Connect with formsflow.ai team."
"Connect with formsflow.ai team.": "Connect with formsflow.ai team.",
"Proceed to Sign In": "Proceed to Sign In",
"Contact formsflow.ai support": "Contact formsflow.ai support",
"Please provide your tenant name to sign in": "Please provide your tenant name to sign in",
"Tenant not found":"Tenant not found",
"You don't have permission to access this page.": "You don't have permission to access this page.",
"Please contact your administrator or try again later.": "Please contact your administrator or try again later.",
"Return to login": "Return to login"
};


Expand Down
Loading

0 comments on commit c29a28d

Please sign in to comment.