he.js 804 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Hebrew (עברית) language functions
  3. */
  4. ( function ( $ ) {
  5. 'use strict';
  6. $.i18n.languages.he = $.extend( {}, $.i18n.languages[ 'default' ], {
  7. convertGrammar: function ( word, form ) {
  8. switch ( form ) {
  9. case 'prefixed':
  10. case 'תחילית': // the same word in Hebrew
  11. // Duplicate prefixed "Waw", but only if it's not already double
  12. if ( word.slice( 0, 1 ) === 'ו' && word.slice( 0, 2 ) !== 'וו' ) {
  13. word = 'ו' + word;
  14. }
  15. // Remove the "He" if prefixed
  16. if ( word.slice( 0, 1 ) === 'ה' ) {
  17. word = word.slice( 1 );
  18. }
  19. // Add a hyphen (maqaf) before numbers and non-Hebrew letters
  20. if ( word.slice( 0, 1 ) < 'א' || word.slice( 0, 1 ) > 'ת' ) {
  21. word = '־' + word;
  22. }
  23. }
  24. return word;
  25. }
  26. } );
  27. }( jQuery ) );