Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
success: function(data) {
data = data.languagesArray;
this.setState({ languages: data });
// console.log(data);
for (let i = 0; i < data.length; i++) {
if (ISO6391.getNativeName(data[i])) {
languages.push(
<menuitem value="{data[i]}">,
);
} else {
languages.push(
<menuitem value="{data[i]}">,
);
}
}
}.bind(this),
error: function(e) {</menuitem></menuitem>
return parseDir(filename + "/" + child);
})
.filter((v) => v !== null);
}
// it's a directory inside `docs` folder
else {
info.type = "category";
let catName = path.basename(filename);
if (catName[0] == "_") {
catName = catName.substring(1);
}
catName = catName.replace("_", " ");
if (catName.length == 2) {
catName = ISO6391.getNativeName(catName);
} else if (catName.length == 5) {
// Taiwan uses Traditional Chinese as its script, we're using ISO codes
// for countries not languages, so this slight modification is for that.
if (catName == "zh-tw") {
catName = "繁體中文";
} else if (catName == "zh-cn") {
catName = "简体中文";
}
}
if (CATEGORY_NAME_CAPITALIZATION) {
info.label = catName.charAt(0).toUpperCase() + catName.substring(1);
} else {
info.label = catName;
}
componentDidMount() {
document.title = `SUSI.AI - ${ISO6391.getNativeName(
this.props.location.pathname.split('/')[2],
)} Skills`;
}
render() {
<img size="40" name="{name}" src="{[pngImage," style="{imageStyle}">}
/>
<div>
<a href="{skillURL}">
{name}
</a>
</div>
{category}
{ISO6391.getNativeName(language)}
);
});
return skills;
<title>Skill Details</title>
<table>
<tbody>
<tr>
<td>Category: </td>
<td>
{this.groupValue}
</td>
</tr>
<tr>
<td>Language: </td>
<td>
{ISO6391.getNativeName(this.languageValue)}
</td>
</tr>
<tr>
<td>Updated on: </td>
<td>{` ${parseDate(lastModifiedTime)}`}</td>
</tr>
<tr>
<td>Languages supported:</td>
<td>
{supportedLanguages.map((data, index) => {
const delimiter =
supportedLanguages.length === index + 1 ? null : ', ';
return (
</td></tr></tbody></table>
return this.props.languages.map(name => (
<menuitem checked="{values"> -1}
value={name}
>
{ISO6391.getNativeName(name)
? ISO6391.getNativeName(name)
: 'Universal'}
</menuitem>
));
};
<a href="{skillURL}">
<img size="40" name="{name}" src="{[pngImage,">}
/>
</a>
{name}
{category}
{ISO6391.getNativeName(language)}
);
});
return skills;
{supportedLanguages.map((data, index) => {
const delimiter =
supportedLanguages.length === index + 1 ? null : ', ';
return (
{ISO6391.getNativeName(data.language)}
{delimiter}
);
})}
.then(payload => {
const data = payload.languagesArray;
this.setState({ languages: data });
for (let i = 0; i < data.length; i++) {
if (ISO6391.getNativeName(data[i])) {
languages.push(
<menuitem value="{data[i]}">
{ISO6391.getNativeName(data[i])}
</menuitem>,
);
} else {
languages.push(
<menuitem value="{data[i]}">
Universal
</menuitem>,
);
}
if (data[i] === 'en') {
this.handleLanguageChange(null, 0, 'en');
this.setState({ languageSelect: false, expertSelect: false });
}
}
languages.sort(function(a, b) {
if (a.props.primaryText < b.props.primaryText) {
const getLanguageName = (short: string) =>
ISO6391.getNativeName(short) || missingLanguages?.[short] || short;