How to use the iso-639-1.getNativeName function in iso-639-1

To help you get started, we’ve selected a few iso-639-1 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fossasia / susi_skill_cms / src / components / SkillEditor / SkillEditor.js View on Github external
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>
github openmultiplayer / web / frontend / scripts / gentree.js View on Github external
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;
      }
github fossasia / susi_skill_cms / src / components / BrowseSkill / BrowseSkillByLanguage.js View on Github external
componentDidMount() {
    document.title = `SUSI.AI - ${ISO6391.getNativeName(
      this.props.location.pathname.split('/')[2],
    )} Skills`;
  }
  render() {
github fossasia / susi_skill_cms / src / components / AuthorSkills / AuthorSkills.js View on Github external
<img size="40" name="{name}" src="{[pngImage," style="{imageStyle}">}
              /&gt;
            
          
          
            <div>
              <a href="{skillURL}">
                {name}
              </a>
            </div>
          
          {category}
          {ISO6391.getNativeName(language)}
        
      );
    });
    return skills;
github fossasia / susi.ai / src / components / cms / SkillPage / SkillListing.js View on Github external
<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) =&gt; {
                      const delimiter =
                        supportedLanguages.length === index + 1 ? null : ', ';
                      return (
                        </td></tr></tbody></table>
github fossasia / susi_skill_cms / src / components / BrowseSkill / BrowseSkill.js View on Github external
return this.props.languages.map(name =&gt; (
      <menuitem checked="{values"> -1}
        value={name}
      &gt;
        {ISO6391.getNativeName(name)
          ? ISO6391.getNativeName(name)
          : 'Universal'}
      </menuitem>
    ));
  };
github fossasia / susi.ai / src / components / cms / AuthorSkills / AuthorSkills.js View on Github external
<a href="{skillURL}">
              <img size="40" name="{name}" src="{[pngImage,">}
              /&gt;
            </a>
          
          
            {name}
          
          
            {category}
          
          {ISO6391.getNativeName(language)}
        
      );
    });
    return skills;
github fossasia / susi.ai / src / components / cms / SkillPage / SkillListing.js View on Github external
{supportedLanguages.map((data, index) =&gt; {
                      const delimiter =
                        supportedLanguages.length === index + 1 ? null : ', ';
                      return (
                        
                          {ISO6391.getNativeName(data.language)}
                          {delimiter}
                        
                      );
                    })}
github fossasia / susi_skill_cms / src / components / SkillCreator / SkillCreator.js View on Github external
.then(payload =&gt; {
          const data = payload.languagesArray;
          this.setState({ languages: data });
          for (let i = 0; i &lt; 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 &lt; b.props.primaryText) {
github openmultiplayer / web / frontend / src / utils / getLanguageName.ts View on Github external
const getLanguageName = (short: string) =>
  ISO6391.getNativeName(short) || missingLanguages?.[short] || short;