@memberof inflector#

@description

Transforms a string to its singular form.

@param {string} _string String to transform
@param {string} _locale) Locale to use, defaults to the default locale
@return {string} The transformed string
329880
function(_string, _locale) {
            var rules = loadRulesFor(_locale);
            return rules ? applyRules(_string, rules.singular, rules.uncountable) : _string;
          }
1366579
function (str, lang) {
  if (!(lang && hljs.getLanguage(lang))) {
    return ''
  }

  try {
    return replaceDelimiters(hljs.highlight(lang, str, true).value)
  } catch (err) {}
}
318657
static function toNFD( $string ) {
		if ( NORMALIZE_INTL ) {
			return normalizer_normalize( $string, Normalizer::FORM_D );
		} elseif ( preg_match( '/[\x80-\xff]/', $string ) ) {
			return self::NFD( $string );
		} else {
			return $string;
		}
	}
1374999
public static Locale parseLocale(String localeString) {
        if (localeString == null || localeString.length() == 0) {
            return Locale.getDefault();
        }
        localeString = localeString.trim();

        if (localeString == null) {
            return null;
        }

        String language = "";
        String country = "";
        String variant = "";

        // language
        int start = 0;
        int index = localeString.indexOf("_");

        if (index >= 0) {
            language = localeString.substring(start, index).trim();

            // country
            start = index + 1;
            index = localeString.indexOf("_", start);

            if (index >= 0) {
                country = localeString.substring(start, index).trim();

                // variant
                variant = localeString.substring(index + 1).trim();
            } else {
                country = localeString.substring(start).trim();
            }
        } else {
            language = localeString.substring(start).trim();
        }

        return new Locale(language, country, variant);
    }
1361427
function translate(singular, plural) {
    if (!locales[currentLocale]) {
        read(currentLocale);
    }

    if (plural) {
        if (!locales[currentLocale][singular]) {
            locales[currentLocale][singular] = {
                'one': singular,
                'other': plural
            };
            write(currentLocale);
        }
    }

    if (!locales[currentLocale][singular]) {
        locales[currentLocale][singular] = singular;
        write(currentLocale);
    }
    return locales[currentLocale][singular];
}
10671
public function inflect(string $string, $pluralize = 0) : string
    {
        return ($pluralize) ? Inflect::pluralize($string) : Inflect::singularize($string);
    }
387984
function getLocalESLintVersion() {
    try {
        const eslintPath = relativeModuleResolver("eslint", path.join(process.cwd(), "__placeholder__.js"));
        const eslint = require(eslintPath);

        return eslint.linter.version || null;
    } catch (_err) {
        return null;
    }
}
1130658
public static String toTitleCase(String string)
    {
        Check.notNull(string);

        final int length = string.length();
        final StringBuilder result = new StringBuilder(length);
        for (int i = 0; i < length; i++)
        {
            final String next = string.substring(i, i + 1);
            if (i == 0)
            {
                result.append(next.toUpperCase(Locale.ENGLISH));
            }
            else
            {
                result.append(next.toLowerCase(Locale.ENGLISH));
            }
        }
        return result.toString();
    }
762860
public static function singular($string)
    {
        $result = $string;
        foreach (self::$_singular as $rule => $replacement) {
            $rule = self::_normalize($rule);
            if (preg_match($rule, $string)) {
                $result = preg_replace($rule, $replacement, $string);
                break;
            }
        }
        return $result;
    }
1142945
function MessageFormat(message, locales, formats) {
  // Parse string messages into an AST.
  var ast = typeof message === 'string' ? MessageFormat.__parse(message) : message;

  if (!(ast && ast.type === 'messageFormatPattern')) {
    throw new TypeError('A message must be provided as a String or AST.');
  } // Creates a new object with the specified `formats` merged with the default
  // formats.


  formats = this._mergeFormats(MessageFormat.formats, formats); // Defined first because it's used to build the format pattern.

  defineProperty(this, '_locale', {
    value: this._resolveLocale(locales)
  }); // Compile the `ast` to a pattern that is highly optimized for repeated
  // `format()` invocations. **Note:** This passes the `locales` set provided
  // to the constructor instead of just the resolved locale.

  var pluralFn = this._findPluralRuleFunction(this._locale);

  var pattern = this._compilePattern(ast, locales, formats, pluralFn); // "Bind" `format()` method to `this` so it can be passed by reference like
  // the other `Intl` APIs.


  var messageFormat = this;

  this.format = function (values) {
    try {
      return messageFormat._format(pattern, values);
    } catch (e) {
      if (e.variableId) {
        throw new Error('The intl string context variable \'' + e.variableId + '\'' + ' was not provided to the string \'' + message + '\'');
      } else {
        throw e;
      }
    }
  };
}
517571
function toCamel(string) {
        if (string === null || string === undefined) {
            return "";
        }
        return String(string).replace(/((\s|\-|\.)+[a-z0-9])/g, function($1) {
            return $1.toUpperCase().replace(/(\s|\-|\.)/g, "");
        });
    }
120469
function stringTrimLeft (str) {
  return str && str.trimLeft ? str.trimLeft() : ('' + str).replace(/^[\s\uFEFF\xA0]+/g, '')
}
963904
function tweakI18nStrings(data) {
  // Rip off the CommonJS header/footer
  var output = '';
  data.replace(outline, function(m, inner) {
    // Remove the trailing spaces
    output += inner.replace(/ *$/, '');
  });

  if (output === '') {
    throw new Error('Mismatch in lib/gcli/nls/strings.js');
  }

  var strings = [];

  // Convert each of the string definitions
  var reply = output.replace(singleString, function(m, note, x, name, value) {
    strings.push({
      note: note,
      noteAlsoFor: [],
      name: name,
      value: value
    });
    return '';
  });

  console.log('reply="' + reply + '"');

  strings = strings.filter(function(string) {
    return ignoreStrings.indexOf(string.name) === -1;
  });

  // All strings should have a note, but sometimes we describe several strings
  // with one note, so if a string has no note then we add it to noteAlsoFor
  // in the last string with a note
  var lastStringWithNote = -1;
  strings.forEach(function(string, i) {
    if (string.note === '') {
      strings[lastStringWithNote].noteAlsoFor.push(string.name);
    }
    else {
      lastStringWithNote = i;
    }
  });

  // Make a single one line string from the the multi-line JS comments
  strings.forEach(function(string) {
    if (string.note !== '') {
      string.note = string.note.replace(/\n? *\/\/ */g, ' ')
                               .replace(/^ /, '')
                               .replace(/\n$/, '');
    }
  });

  // Add the 'LOCALIZATION NOTE' and word wrap
  strings.forEach(function(string) {
    if (string.note !== '') {
      string.noteAlsoFor.unshift(string.name);
      var names = '';
      if (string.noteAlsoFor.length > 1) {
        names = ' (' + string.noteAlsoFor.join(', ') + ')';
      }

      string.note = 'LOCALIZATION NOTE' + names + ': ' + string.note;
      string.note = '\n# ' + wordWrap(string.note, 77).join('\n# ') + '\n';
    }
  });

  // The values were escaped JavaScript strings to be property values they
  // need unescaping
  strings.forEach(function(string) {
    string.value = string.value.replace(/\\\\/g, '\\').replace(/\\'/g, '\'');
  });

  // Join to get the output
  output = strings.map(function(string) {
    return string.note + string.name + '=' + string.value + '\n';
  }).join('');

  return '' +
    '# This Source Code Form is subject to the terms of the Mozilla Public\n' +
    '# License, v. 2.0. If a copy of the MPL was not distributed with this\n' +
    '# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n' +
    '\n' +
    '# LOCALIZATION NOTE These strings are used inside the Web Console\n' +
    '# command line which is available from the Web Developer sub-menu\n' +
    '# -> \'Web Console\'.\n' +
    '# The correct localization of this file might be to keep it in\n' +
    '# English, or another language commonly spoken among web developers.\n' +
    '# You want to make that choice consistent across the developer tools.\n' +
    '# A good criteria is the language in which you\'d find the best\n' +
    '# documentation on web development on the web.\n' +
    '\n' +
    '# For each command there are in general two strings. As an example consider\n' +
    '# the \'pref\' command.\n' +
    '# commandDesc (e.g. prefDesc for the command \'pref\'): this string contains a\n' +
    '# very short description of the command. It\'s designed to be shown in a menu\n' +
    '# alongside the command name, which is why it should be as short as possible.\n' +
    '# commandManual (e.g. prefManual for the command \'pref\'): this string will\n' +
    '# contain a fuller description of the command. It\'s diplayed when the user\n' +
    '# asks for help about a specific command (e.g. \'help pref\').\n' +
    output;
}
344760
function _format (input, locale) {
  locale = locale || Locale.browserLocale() // eslint-disable-line no-param-reassign

  let result = input

  const { thousands, decimal } = Decimal.getDelimiters(locale)
  const isNegative = (result[0] === '-')

  // remove all characters except for digits and decimal delimiters
  result = result.replace(new RegExp(`[^\\d\\${decimal}]`, 'g'), '')

  // remove all decimal delimiters except for the last one if present
  result = result.replace(new RegExp(`[${decimal}](?=.*[${decimal}])`, 'g'), '')

  // remove the leading zeros using positive lookahead
  result = result.replace(new RegExp(`^[0${thousands}]+(?=\\d|0${decimal})`, ''), '')

  // add leading zero to decimal, if not present
  result = result.charAt(0) === decimal ? result.replace(/^/, '0') : result

  const parts = result.split(decimal)
  const thousandSections = []

  let curr = parts[0]
  while (curr.length > 0) {
    thousandSections.unshift(curr.substr(Math.max(0, curr.length - 3), 3))
    curr = curr.substr(0, curr.length - 3)
  }

  result = thousandSections.join(thousands)

  if (parts[1]) {
    result = `${result}${decimal}${parts[1]}`
  }

  if (isNegative && result) {
    result = `-${result}`
  }

  return result
}
56659
function parse(str) {
    str = str.replace(/\n/, ';');
    str = str.replace(/RRULE:/, '');
    str = str.replace(/DTSTART;/, 'DTSTART__SEMI__');
    var pairs = str.split(';')
      , obj = {}
      ;

    pairs.forEach(function (pair) {
      pair = pair.replace(/DTSTART__SEMI__/, 'DTSTART;');
      var parts = pair.split('=')
        , k = parts[0]
        , ks
        , param
        , tzid
        , vstr = parts[1]
        , v
        ;

      // Handle case of DTSTART;TZID=US-Eastern:{{yyyymmddThhmmss}} // NO Z ALLOWED
      ks = k.split(';');
      k = ks[0];

      // TZID exists
      if ('TZID' === ks[1]) {
        param = ks[1].split(':');
        tzid = param[0];
        obj.tzid = tzid;
        v = param[1];
      }

      // Handle case of DTSTART;LOCALE=GMT-0600 (MDT):{{yyyymmddThhmmss}} // NO Z ALLOWED
      // obj.locale = obj.locale || stringifyGmtZone(obj.dtstart);
      if ('LOCALE' === ks[1]) {
        if (localeWarn2) {
          console.warn('[parse] falling back to non-standard locale definition for timezone');
          localeWarn2 = false;
        }
        param = vstr.split(':');
        obj.locale = param[0];

        // Continue with DTSTART
        k = ks[0];
        vstr = v = param[1];
      }

      switch (k) {
      case 'DTSTART':
      case 'UNTIL':
        v = Rrecur.toRruleDateString(vstr);
        break;
      case 'FREQ':
      case 'WKST':
        v = vstr.toLowerCase();
        break;
      case 'INTERVAL':
      case 'COUNT':
        v = vstr;
        break;
      case 'BYWEEKDAY':
        console.warn('converting rrule.js BYWEEKDAY to rrule rfc BYDAY');
        k = 'BYDAY';
        /* fall through */
      case 'BYSETPOS':
      case 'BYYEARDAY':
      case 'BYMONTH':
      case 'BYWEEKNO':
      case 'BYDAY':
      case 'BYMONTHDAY':
      case 'BYHOUR':
      case 'BYMINUTE':
      case 'BYSECOND':
      case 'BYEASTER':
        v = vstr.split(',');
        v.forEach(function (val, i) {
          v[i] = val.toLowerCase();
        });
        break;
      }

      obj[k.toLowerCase()] = v;
    });

    return obj;
  }
896815
static function &translate($in_string)
    {
        $out_string = &$in_string;
        
        $langage = ReporticoApp::getConfig("language");
        $translations = ReporticoApp::get("translations");
        
        if ($translations) {
            if (array_key_exists($langage, $translations)) {
                $langset = &$translations[$langage];
                if (isset($langset[$in_string])) {
                    $out_string = &$langset[$in_string];
                }

            }
        }
        

        return $out_string;
    }
334968
public function translate($string)
    {
        $args = func_get_args();
        $translated = array_shift($args);
        $extraParams = $args;
        if (count($extraParams)>0)
        {
            $translated = vsprintf($translated, $extraParams);
        }

        return $translated;
    }