| 1198 | } |
| 1199 | |
| 1200 | function i8ln (word) { |
| 1201 | if ($.isEmptyObject(i8lnDictionary) && language !== 'en' && languageLookups < languageLookupThreshold) { |
| 1202 | $.ajax({ |
| 1203 | url: 'static/dist/locales/' + language + '.min.json', |
| 1204 | dataType: 'json', |
| 1205 | async: false, |
| 1206 | success: function (data) { |
| 1207 | i8lnDictionary = data |
| 1208 | }, |
| 1209 | error: function (jqXHR, status, error) { |
| 1210 | console.log('Error loading i8ln dictionary: ' + error) |
| 1211 | languageLookups++ |
| 1212 | } |
| 1213 | }) |
| 1214 | } |
| 1215 | if (word in i8lnDictionary) { |
| 1216 | return i8lnDictionary[word] |
| 1217 | } else { |
| 1218 | // Word doesn't exist in dictionary return it as is |
| 1219 | return word |
| 1220 | } |
| 1221 | } |
| 1222 | |
| 1223 | // |
| 1224 | // Page Ready Exection |