Skip to content

Commit aa0478c

Browse files
committed
Merge branch 'v2-dev' into v2
2 parents d8124c5 + 8ad3cee commit aa0478c

File tree

8 files changed

+96
-8
lines changed

8 files changed

+96
-8
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ workflows:
129129
only:
130130
- dev
131131
- v2
132+
ignore:
132133
- v2-dev
133134
- build_next:
134135
requires:
@@ -138,6 +139,7 @@ workflows:
138139
only:
139140
- dev
140141
- v2
142+
ignore:
141143
- v2-dev
142144
- publish_next:
143145
requires:
@@ -147,6 +149,7 @@ workflows:
147149
only:
148150
- dev
149151
- v2
152+
ignore:
150153
- v2-dev
151154
release:
152155
jobs:

CHANGELOG.JSON

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
{
22
"versions": [
3+
{
4+
"version": "2.10.0",
5+
"changes": {
6+
"new": [],
7+
"enhancements": [],
8+
"fixes": [
9+
"`TaxonomyPicker`: suggestions language is always English [#879](https://github.com/pnp/sp-dev-fx-controls-react/issues/879)"
10+
]
11+
},
12+
"contributions": [
13+
"[Peter Paul Kirschner](https://github.com/petkir)"
14+
]
15+
},
316
{
417
"version": "2.9.0",
518
"changes": {

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@pnp/spfx-controls-react",
33
"description": "Reusable React controls for SharePoint Framework solutions",
4-
"version": "2.9.0",
4+
"version": "2.10.0",
55
"engines": {
66
"node": ">=10"
77
},

src/common/utilities/LocalesHelper.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
export class LocalesHelper {
2+
3+
private static locales = {
4+
1025: 'ar-SA',
5+
1026: 'bg-BG',
6+
1027: 'ca-ES',
7+
1028: 'zh-TW',
8+
1029: 'cs-CZ',
9+
1030: 'da-DK',
10+
1031: 'de-DE',
11+
1032: 'el-GR',
12+
1033: 'en-US',
13+
1035: 'fi-FI',
14+
1036: 'fr-FR',
15+
1037: 'he-IL',
16+
1038: 'hu-HU',
17+
1040: 'it-IT',
18+
1041: 'ja-JP',
19+
1042: 'ko-KR',
20+
1043: 'nl-NL',
21+
1044: 'nb-NO',
22+
1045: 'pl-PL',
23+
1046: 'pt-BR',
24+
1048: 'ro-RO',
25+
1049: 'ru-RU',
26+
1050: 'hr-HR',
27+
1051: 'sk-SK',
28+
1053: 'sv-SE',
29+
1054: 'th-TH',
30+
1055: 'tr-TR',
31+
1057: 'id-ID',
32+
1058: 'uk-UA',
33+
1060: 'sl-SI',
34+
1061: 'et-EE',
35+
1062: 'lv-LV',
36+
1063: 'lt-LT',
37+
1066: 'vi-VN',
38+
1068: 'az-Latn-AZ',
39+
1069: 'eu-ES',
40+
1071: 'mk-MK',
41+
1081: 'hi-IN',
42+
1086: 'ms-MY',
43+
1087: 'kk-KZ',
44+
1106: 'cy-GB',
45+
1110: 'gl-ES',
46+
1164: 'prs-AF',
47+
2052: 'zh-CN',
48+
2070: 'pt-PT',
49+
2108: 'ga-IE',
50+
3082: 'es-ES',
51+
5146: 'bs-Latn-BA',
52+
9242: 'sr-Latn-RS',
53+
10266: 'sr-Cyrl-RS',
54+
};
55+
public static getLocaleId(localeName: string): number {
56+
const pos: number = Object.keys(this.locales).findIndex(locKey => this.locales[locKey] === localeName);
57+
if (pos > -1) {
58+
return parseInt(Object.keys(this.locales)[pos]);
59+
}
60+
else {
61+
return 0;
62+
}
63+
}
64+
65+
public static getLocaleName(localeId: number): string {
66+
return this.locales[localeId] || '';
67+
}
68+
69+
70+
}

src/common/utilities/SPHelper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import '@pnp/sp/fields';
99
import { SPHttpClient } from '@microsoft/sp-http';
1010
import { IFieldInfo } from '@pnp/sp/fields';
1111
import '@pnp/sp/site-users/web';
12+
import '@pnp/sp/webs';
1213

1314
declare var window: any;
1415

src/common/utilities/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from './FieldRendererHelper';
22
export * from './GeneralHelper';
3-
export * from './SPHelper';
3+
export * from './SPHelper';
4+
export * from './LocalesHelper';

src/services/SPTermStorePickerService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import SPTermStoreMockHttpClient from './SPTermStorePickerMockService';
1515
import { findIndex } from '@microsoft/sp-lodash-subset';
1616
import { ExtensionContext } from '@microsoft/sp-extension-base';
1717
import { EmptyGuid } from '../common/Constants';
18-
18+
import { LocalesHelper } from '../common/utilities/LocalesHelper';
1919

2020
/**
2121
* Service implementation to manage term stores in SharePoint
@@ -297,7 +297,7 @@ export default class SPTermStorePickerService {
297297
return null;
298298
}
299299
}
300-
else{
300+
else {
301301
return null;
302302
}
303303
} catch (error) {
@@ -327,7 +327,7 @@ export default class SPTermStorePickerService {
327327
const {
328328
termsetNameOrID,
329329
hideDeprecatedTags,
330-
hideTagsNotAvailableForTagging,
330+
hideTagsNotAvailableForTagging,
331331
} = this.props;
332332

333333
const terms = await this.getAllTermsByAnchorId(
@@ -424,10 +424,10 @@ export default class SPTermStorePickerService {
424424
resolve(null);
425425
return;
426426
}
427-
427+
let loc = LocalesHelper.getLocaleId(this.context.pageContext.cultureInfo.currentUICultureName);
428428
let data = {
429429
start: searchText,
430-
lcid: this.context.pageContext.web.language, // TODO : get the user's navitation LCID. Here it's the default web language LCID
430+
lcid: loc !== 0 ? loc : this.context.pageContext.web.language,
431431
sspList: this.cleanGuid(termStore[0].Id),
432432
termSetList: TermSetId,
433433
anchorId: this.props.anchorId ? this.props.anchorId : EmptyGuid,

0 commit comments

Comments
 (0)