Skip to content

Commit

Permalink
add multilanguage support for surveys
Browse files Browse the repository at this point in the history
  • Loading branch information
selul committed Aug 8, 2024
1 parent 4bba50c commit cb3ec00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions assets/apps/dashboard/src/utils/survey.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ if ('undefined' !== typeof window && 'undefined' !== typeof window.neveDash) {
days_since_install: convertToCategory(
window.neveDash.daysSinceInstall
),
language: window.neveDash.lang,
license_status: window.neveDash?.license?.valid ?? 'invalid',
free_version: window.neveDash?.version,
pro_version: window.neveDash?.proPluginVersion,
Expand Down
7 changes: 7 additions & 0 deletions inc/admin/dashboard/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,13 @@ private function get_localization() {
if ( isset( $_GET['onboarding'] ) && $_GET['onboarding'] === 'yes' ) {
$data['isOnboarding'] = true;
}
$language = get_user_locale();
$available_languages = [
'de_DE' => 'de',
'de_DE_formal' => 'de',
];
$lang_code = isset( $available_languages[ $language ] ) ? 'de' : 'en';
$data['lang'] = $lang_code;

return $data;
}
Expand Down

0 comments on commit cb3ec00

Please sign in to comment.