How to use the i18n-iso-countries.getName function in i18n-iso-countries

To help you get started, we’ve selected a few i18n-iso-countries 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 ovanta / vue-cloudfront-api / src / websocket.js View on Github external
if (!(userid in userMap)) {
                                userMap[userid] = {
                                    websockets: [],
                                    lastBroadcast: 0
                                };
                            } else if (userMap[userid].websockets.includes(ws)) {
                                return;
                            }

                            // Lookup ip info
                            const lu = geoip.lookup(req.connection.remoteAddress);

                            ws._sessionInfo = {
                                id: Math.floor(Math.random() * 1e15).toString(16) + Date.now().toString(16),
                                city: lu ? lu.city : 'Unknown',
                                country: lu ? i18nCountries.getName(lu.country, 'en') : 'Unknown',
                                device: userAgentParser(req.headers['user-agent'])
                            };

                            // Push to redis
                            redisClient.rpush(userid.toString(), JSON.stringify(ws._sessionInfo));

                            websocket.broadcast({
                                userid,
                                data: {
                                    type: 'open-session',
                                    value: ws._sessionInfo
                                }
                            });

                            // Append websocket
                            userMap[userid].websockets.push(ws);
github danielgrijalva / overworld / frontend / src / modules / game / components / details / index.js View on Github external
.map(companyInfo =>
              countries.getName(companyInfo.company.country, "en")
            )
github HaliteChallenge / Halite-III / website / javascript / templates / LeagueIndividual.vue View on Github external
getCountryName: function (name) {
        var countries = require('i18n-iso-countries')
        return countries.getName(name, 'en')
      },
      copyToClipboard: function(){
github philsturgeon / awesome-earth / src / countries.js View on Github external
fromAlpha2Code: code => {
    return {
      name: countries.getName(code, 'en'),
      emoji: flag(code),
    };
  },
};
github danielgrijalva / overworld / frontend / src / modules / game / components / details / index.js View on Github external
.map(companyInfo =>
              countries.getName(companyInfo.company.country, "en")
            )
github SwitchbladeBot / switchblade / src / commands / games / steamladder / steamladder.js View on Github external
generateLadderEmbedTitle ({ type, country_code: cc }, t, language) {
    const title = t(`commands:steamladder.ladders.${type}`)
    if (cc) {
      const suffix = ` - ${title}`
      if (this.client.i18next.exists(`commands:steamladder.regions.${cc}`)) {
        return t(`commands:steamladder.regions.${cc}`) + suffix
      } else if (countries.getName(cc, language.substring(0, 2))) {
        return countries.getName(cc, language.substring(0, 2)) + suffix
      } else {
        return cc + suffix
      }
    }
    return title
  }
github massyao / china-invalid-vaccine-flow / js / model / map-model.js View on Github external
case 'SYR':
            return 'Syria';
        case 'MKD':
            return 'Macedonia';
        case 'IRN':
            return 'Iran';
        case 'LBY':
            return 'Libya';
        case 'RUS':
            return 'Russia';
        case 'RCB':
            return 'Congo';
        case 'COD':
            return 'Congo';
    }
    return countries.getName(country, 'en');
};
github ezpaarse-project / ezpaarse / client / pages / format.vue View on Github external
alphaToName (alpha, locale) {
      return i18nIsoCode.getName(alpha, locale) || alpha;
    }
  },
github lucified / lucify-refugees / src / js / model / map-model.js View on Github external
MapModel.prototype.getFriendlyNameForCountry = function(country) {
  switch(country) {
    case 'SYR': return 'Syria';
    case 'MKD': return 'Macedonia';
    case 'IRN': return 'Iran';
    case 'LBY': return 'Libya';
    case 'RUS': return 'Russia';
    case 'RCB': return 'Congo';
    case 'COD': return 'Congo';
  }
  return countries.getName(country, 'en');
};