Merge pull request #4839 from pengpengshui/language

Modify issue about cannot switch language to franch
This commit is contained in:
Qian Deng 2018-05-03 15:57:19 +08:00 committed by GitHub
commit 9e1e66beeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -11,12 +11,13 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
export const supportedLangs = ['en-us', 'zh-cn', 'es-es'];
export const supportedLangs = ['en-us', 'zh-cn', 'es-es', 'fr-fr'];
export const enLang = "en-us";
export const languageNames = {
"en-us": "English",
"zh-cn": "中文简体",
"es-es": "Español"
"es-es": "Español",
"fr-fr": "Français"
};
export const enum AlertType {
DANGER, WARNING, INFO, SUCCESS

View File

@ -34,7 +34,7 @@ export const DEFAULT_LANG_COOKIE_KEY = 'harbor-lang';
/**
* Declare what languages are supported now.
*/
export const DEFAULT_SUPPORTING_LANGS = ['en-us', 'zh-cn', 'es-es'];
export const DEFAULT_SUPPORTING_LANGS = ['en-us', 'zh-cn', 'es-es', 'fr-fr'];
/**
* The default language.
@ -184,7 +184,7 @@ export function doFiltering<T extends { [key: string]: any | any[] }>(items: T[]
let arr = filter['property'].split('.');
if (Array.isArray(item[arr[0]]) && item[arr[0]].length) {
return item[arr[0]].some((data: any) => {
return regexpFilter(filter['value'], data[arr[1]]);
return filter['value'] === data[arr[1]];
});
}
}else {