Localisation updates from https://translatewiki.net.
[mediawiki.git] / resources / lib / jquery.i18n / src / languages / fi.js
blob3452601609d9fcbcea31bd37fc569e7cd9ae806c
1 /**
2  * Finnish (Suomi) language functions
3  *
4  * @author Santhosh Thottingal
5  */
7 ( function ( $ ) {
8         'use strict';
10         $.i18n.languages.fi = $.extend( {}, $.i18n.languages[ 'default' ], {
11                 convertGrammar: function ( word, form ) {
12                         // vowel harmony flag
13                         var aou = word.match( /[aou][^äöy]*$/i ),
14                                 origWord = word;
15                         if ( word.match( /wiki$/i ) ) {
16                                 aou = false;
17                         }
19                         // append i after final consonant
20                         if ( word.match( /[bcdfghjklmnpqrstvwxz]$/i ) ) {
21                                 word += 'i';
22                         }
24                         switch ( form ) {
25                                 case 'genitive':
26                                         word += 'n';
27                                         break;
28                                 case 'elative':
29                                         word += ( aou ? 'sta' : 'stä' );
30                                         break;
31                                 case 'partitive':
32                                         word += ( aou ? 'a' : 'ä' );
33                                         break;
34                                 case 'illative':
35                                 // Double the last letter and add 'n'
36                                         word += word.slice( -1 ) + 'n';
37                                         break;
38                                 case 'inessive':
39                                         word += ( aou ? 'ssa' : 'ssä' );
40                                         break;
41                                 default:
42                                         word = origWord;
43                                         break;
44                         }
46                         return word;
47                 }
48         } );
49 }( jQuery ) );