File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -115,11 +115,11 @@ export class OneDriveService extends FileBrowserService {
115
115
if ( ! oneDriveLibsData || ! oneDriveLibsData . value || oneDriveLibsData . value . length === 0 ) {
116
116
throw new Error ( `Cannot read one drive libs data.` ) ;
117
117
}
118
-
118
+ const isDefaultLang = this . isCurrentLanguageDefault ( ) ;
119
119
const myDocumentsLibrary = oneDriveLibsData . value [ 0 ] ;
120
- this . oneDrivePersonalLibraryTitle = myDocumentsLibrary . Title ;
121
- this . oneDriveRootFolderRelativeUrl = `${ myDocumentsLibrary . ParentWebUrl } /${ myDocumentsLibrary . Title } ` ;
122
- this . oneDriveRootFolderAbsoluteUrl = `${ this . oneDrivePersonalUrl } ${ myDocumentsLibrary . Title } ` ;
120
+ this . oneDrivePersonalLibraryTitle = isDefaultLang ? myDocumentsLibrary . Title : myDocumentsLibrary . EntityTypeName ;
121
+ this . oneDriveRootFolderRelativeUrl = `${ myDocumentsLibrary . ParentWebUrl } /${ isDefaultLang ? myDocumentsLibrary . Title : myDocumentsLibrary . EntityTypeName } ` ;
122
+ this . oneDriveRootFolderAbsoluteUrl = `${ this . oneDrivePersonalUrl } ${ isDefaultLang ? myDocumentsLibrary . Title : myDocumentsLibrary . EntityTypeName } ` ;
123
123
} catch ( error ) {
124
124
console . error ( `[FileBrowserService.getOneDrivePersonalUrl] Err='${ error . message } '` ) ;
125
125
this . oneDriveRootFolderAbsoluteUrl = null ;
@@ -183,4 +183,11 @@ export class OneDriveService extends FileBrowserService {
183
183
protected buildAbsoluteUrl = ( relativeUrl : string ) : string => {
184
184
return `https://${ this . oneDrivePersonalUrl . split ( "//" ) [ 1 ] . split ( "/" ) [ 0 ] } ${ relativeUrl } ` ;
185
185
}
186
+
187
+ /**
188
+ * Checks if the current language is default (en-US)
189
+ */
190
+ public isCurrentLanguageDefault ( ) : boolean {
191
+ return this . context . pageContext . cultureInfo . currentUICultureName === 'en-US' ;
192
+ }
186
193
}
You can’t perform that action at this time.
0 commit comments