diff --git a/README.md b/README.md index d2c70f5b..a887c99d 100644 --- a/README.md +++ b/README.md @@ -58,14 +58,16 @@ NodeJS Map clone replacement for [RealDeviceMap](https://github.com/realdevicema - [Mygod](https://github.com/Mygod) - [TurtIeSocks](https://github.com/TurtIeSocks) - [Bukowskaii](https://github.com/Bukowskaii) +- [lenisko](https://github.com/lenisko) - [clburlison](https://github.com/clburlison) - [bschultz](https://github.com/bschultz) - [PartTimeJS](https://github.com/PartTimeJS) - [sabregreen](https://github.com/sabregreen) +- [ZombieCorn80](https://github.com/ZombieCorn80) - [ArcanoxDragon](https://github.com/ArcanoxDragon) - [DarthButcher](https://github.com/darthbutcher) - [LordJavi](https://github.com/LordJavi) -- [ZombieCorn80](https://github.com/ZombieCorn80) +- [shadowfox931](https://github.com/shadowfox931) - [Andrew Cameron](https://github.com/amcameron) ## Credits diff --git a/src/configs/config.example.json b/src/configs/config.example.json index 27c5a0a1..a2eb9e9b 100644 --- a/src/configs/config.example.json +++ b/src/configs/config.example.json @@ -4,6 +4,7 @@ "title": "MapJS", "headerTitle": "MapJS - NodeJS Map Replacement", "locale": "en", + "dateTimeLocale": "en-US", "style": "dark", "sessionSecret": "98ki^e72~!@#(85o3kXLI*#c9wu5l!Z", "homepage": { diff --git a/src/configs/default.json b/src/configs/default.json index 53626694..3459a678 100644 --- a/src/configs/default.json +++ b/src/configs/default.json @@ -4,6 +4,7 @@ "title": "MapJS", "headerTitle": "MapJS - NodeJS Map Replacement", "locale": "en", + "dateTimeLocale": "en-US", "style": "dark", "dbType": "rdm", "searchMaxResults": 20, diff --git a/src/data/default.js b/src/data/default.js index d768b203..d47fd5c7 100644 --- a/src/data/default.js +++ b/src/data/default.js @@ -5,6 +5,7 @@ const data = require('../../static/locales/' + config.locale + '.json'); data.title = config.title; data.header_title = config.headerTitle; data.locale = config.locale; +data.date_time_locale = config.dateTimeLocale; data.db_type = config.dbType; data.google_analytics_id = config.google.analytics; data.google_adsense_id = config.google.adsense; diff --git a/src/index.js b/src/index.js index 88c6fde1..7ca3bc27 100644 --- a/src/index.js +++ b/src/index.js @@ -64,7 +64,7 @@ app.use(express.urlencoded({ extended: false, limit: '500mb' })); // Initialize localzation handler i18n.configure({ - locales:['en', 'es', 'de'], + locales:['en', 'es', 'de', 'pl'], directory: path.resolve(__dirname, '../static/locales') }); app.use(i18n.init); diff --git a/src/services/config.js b/src/services/config.js index 36c69768..aa8e6e73 100644 --- a/src/services/config.js +++ b/src/services/config.js @@ -4,7 +4,7 @@ const extend = require('extend'); const uConfig = require('../configs/config.json'); const eConfig = require('../configs/default.json'); const target = {}; -/* +/* * deep Boolean (optional) If set, the merge becomes recursive (i.e. deep copy). * target Object The object to extend. * object1 Object The object that will be merged into the first. diff --git a/src/views/index.mustache b/src/views/index.mustache index aa90d9fa..9ae702cc 100644 --- a/src/views/index.mustache +++ b/src/views/index.mustache @@ -44,6 +44,7 @@ const configPvp = {{{config_pvp_json}}}; const locale = '{{{locale}}}'; + const dateTimeLocale = '{{{date_time_locale}}}'; const localeLastModified = '{{{locale_last_modified}}}'; const availableItems = {{{available_items_json}}}; @@ -889,7 +890,7 @@
- +
diff --git a/static/js/index.js b/static/js/index.js index 78bcc56f..53a396eb 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -3182,7 +3182,7 @@ const getPokemonPopupContent = (pokemon) => {
- + @@ -3196,7 +3196,7 @@ const getPokemonPopupContent = (pokemon) => { - + @@ -3219,11 +3219,11 @@ const getPokemonPopupContent = (pokemon) => { `; if (pokemon.first_seen_timestamp) { const firstSeenDate = new Date(pokemon.first_seen_timestamp * 1000); - content += ``; + content += ``; } if (pokemon.updated !== 0 && pokemon.updated !== null) { const updatedDate = new Date(pokemon.updated * 1000); - content += ``; + content += ``; } return content += `
${despawnDate.toLocaleTimeString()}${despawnDate.toLocaleTimeString(dateTimeLocale)}
${pokemon.expire_timestamp_verified ? '' : ''} ${getTimeUntil(despawnDate)}
${i18n('popup_despawn')}:
${despawnDate.toLocaleTimeString()}${despawnDate.toLocaleTimeString(dateTimeLocale)}
${pokemon.expire_timestamp_verified ? '' : ''} ${getTimeUntil(despawnDate)}
${firstSeenDate.toLocaleTimeString()}
${firstSeenDate.toLocaleTimeString(dateTimeLocale)}
${updatedDate.toLocaleTimeString()}
${updatedDate.toLocaleTimeString(dateTimeLocale)}
`; } @@ -3435,7 +3435,7 @@ function getPokestopPopupContent (pokestop) { if (isActiveLure) { content += `${i18n('popup_lure_type')}: ${getLureName(pokestop.lure_id)}
`; - content += `${i18n('popup_lure_end_time')}: ${lureExpireDate.toLocaleTimeString()} (${getTimeUntil(lureExpireDate)})

`; + content += `${i18n('popup_lure_end_time')}: ${lureExpireDate.toLocaleTimeString(dateTimeLocale)} (${getTimeUntil(lureExpireDate)})

`; } if (invasionExpireDate >= now) { @@ -3443,7 +3443,7 @@ function getPokestopPopupContent (pokestop) { content += `
${i18n('popup_team_rocket_invasion')}
${gruntType}
- ${i18n('popup_end_time')}: ${invasionExpireDate.toLocaleTimeString()} (${getTimeUntil(invasionExpireDate)})
`; + ${i18n('popup_end_time')}: ${invasionExpireDate.toLocaleTimeString(dateTimeLocale)} (${getTimeUntil(invasionExpireDate)})`; content += getPossibleInvasionRewards(pokestop); } @@ -3478,7 +3478,7 @@ function getPokestopPopupContent (pokestop) { const updatedDate = new Date(pokestop.updated * 1000); if (updatedDate) { - content += `
${i18n('popup_last_updated')}: ${updatedDate.toLocaleDateString()} ${updatedDate.toLocaleTimeString()}
`; + content += `
${i18n('popup_last_updated')}: ${updatedDate.toLocaleDateString(dateTimeLocale)} ${updatedDate.toLocaleTimeString()}
`; } const questReward = pokestop.quest_rewards ? pokestop.quest_rewards[0] : {}; @@ -3698,10 +3698,10 @@ function getGymPopupContent (gym) { content += '
'; if (isRaid && !isRaidBattle) { - content += `${i18n('popup_raid_start')}: ` + raidBattleDate.toLocaleTimeString() + ' (' + getTimeUntil(raidBattleDate) + ')
'; + content += `${i18n('popup_raid_start')}: ` + raidBattleDate.toLocaleTimeString(dateTimeLocale) + ' (' + getTimeUntil(raidBattleDate) + ')
'; } if (isRaid) { - content += `${i18n('popup_raid_end')}: ${raidEndDate.toLocaleTimeString()} (${getTimeUntil(raidEndDate)})
`; + content += `${i18n('popup_raid_end')}: ${raidEndDate.toLocaleTimeString(dateTimeLocale)} (${getTimeUntil(raidEndDate)})
`; if (gym.raid_pokemon_id > 0) { content += `${i18n('popup_perfect_cp')}: ${getCpAtLevel(gym.raid_pokemon_id, gym.raid_pokemon_form, 20, true)} / ${i18n('filters_weather')}: ${getCpAtLevel(gym.raid_pokemon_id, gym.raid_pokemon_form, 25, true)}
`; content += `${i18n('popup_worst_cp')}: ${getCpAtLevel(gym.raid_pokemon_id, gym.raid_pokemon_form, 20, false)} / ${i18n('filters_weather')}: ${getCpAtLevel(gym.raid_pokemon_id, gym.raid_pokemon_form, 25, false)}

`; @@ -3717,10 +3717,10 @@ function getGymPopupContent (gym) { const updatedDate = new Date(gym.updated * 1000); const modifiedDate = new Date(gym.last_modified_timestamp * 1000); if (updatedDate) { - content += `
${i18n('popup_last_updated')}: ${updatedDate.toLocaleDateString()} ${updatedDate.toLocaleTimeString()} (${getTimeSince(updatedDate)})
`; + content += `
${i18n('popup_last_updated')}: ${updatedDate.toLocaleDateString(dateTimeLocale)} ${updatedDate.toLocaleTimeString(dateTimeLocale)} (${getTimeSince(updatedDate)})
`; } if (modifiedDate) { - content += `
${i18n('popup_last_modified')}: ${modifiedDate.toLocaleDateString()} ${modifiedDate.toLocaleTimeString()} (${getTimeSince(modifiedDate)})
`; + content += `
${i18n('popup_last_modified')}: ${modifiedDate.toLocaleDateString(dateTimeLocale)} ${modifiedDate.toLocaleTimeString(dateTimeLocale)} (${getTimeSince(modifiedDate)})
`; } content += getNavigation(gym); return content; @@ -3733,7 +3733,7 @@ function getCellPopupContent (cell) { const updatedDate = new Date(cell.updated * 1000); - content += `${i18n('popup_last_updated')}: ${updatedDate.toLocaleTimeString()} (${getTimeSince(updatedDate)})`; + content += `${i18n('popup_last_updated')}: ${updatedDate.toLocaleTimeString(dateTimeLocale)} (${getTimeSince(updatedDate)})`; content += ''; return content; } @@ -3798,7 +3798,7 @@ function getWeatherPopupContent (weather) { ${i18n('popup_boosted')}:
${weatherType.join(', ')}
${weatherTypeIcons.join(' ')}
${extraContent} - ${i18n('popup_last_updated')}: ${updatedDate.toLocaleTimeString()} (${getTimeSince(updatedDate)}) + ${i18n('popup_last_updated')}: ${updatedDate.toLocaleTimeString(dateTimeLocale)} (${getTimeSince(updatedDate)}) `; return content; } @@ -4612,7 +4612,7 @@ function getDeviceMarker (device, ts) { function getDevicePopupContent (device) { const lastSeenDate = new Date(device.last_seen * 1000); - const lastSeen = `${lastSeenDate.toLocaleTimeString()} (${getTimeSince(lastSeenDate)})`; + const lastSeen = `${lastSeenDate.toLocaleTimeString(dateTimeLocale)} (${getTimeSince(lastSeenDate)})`; const ts = Math.round((new Date()).getTime() / 1000); const isOffline = isDeviceOffline(device, ts); const content = `
${device.uuid}

diff --git a/static/locales/_pl.json b/static/locales/_pl.json index 22474bd2..23b8f43f 100644 --- a/static/locales/_pl.json +++ b/static/locales/_pl.json @@ -83,8 +83,8 @@ "filter_global_avg": "Średnie obłożenie nestu", "filter_global_candy_count": "Limit rare candy", "filter_global_stardust_count": "Limit stardustu", - "filter_and": "Oraz", - "filter_or": "Albo", + "filter_and": "ORAZ", + "filter_or": "ALBO", "filter_on": "Włącz", "filter_off": "Wyłącz", "filter_old": "Stare", @@ -190,5 +190,11 @@ "filter_option_rarity": "Według rzadkośći", "filter_option_generation": "Według generacji", "filter_option_form": "Według formy", - "settings_pokemon_notifications": "Powiadomienia o Pokémonach" + "settings_pokemon_notifications": "Powiadomienia o Pokémonach", + "prompt_iv_filter": "• Użyj tego pola, aby wprowadzić specyficzny filtr dla tego Pokémona.\n• Te wartości zastępują wszystkie filtry globalne!\n• Sprawdź przycisk Pomoc, jeśli nie jesteś pewien jak tego użyć. \nPrzykład:\n((L30-35 & 90-100) | (CP2500-4000 & A15 & D10 S10)) | GL1-10 | UL1-10", + "prompt_global_filter": "• Użyj ORAZ, gdy chcesz filtrować Pokémony, które wybrałeś poniżej.\n• Użyj ALBO, gdy chcesz ustawić podstawowy filtr dla wszystkich Pokémonów niezależnie od tego czy wybrałeś je poniżej, czy nie.\n\nJeśli nie jesteś pewien co tu wpisać kliknij na przycisk Pomoc poniżej.", + "prompt_color_value": "Proszę wprowadzić wartość koloru. (np. red, blue, green, etc)", + "prompt_nest_avg": "Proszę wprowadzić średnie obłożenie nestu, aby filtrować. Przykład: 5", + "prompt_candy_amount": "Proszę wpisać ilość cukierków do filtrowania. Przykład: 2", + "prompt_stardust_amount": "Proszę podać ilość stardustu do filtrowania. Przykład: 0, 500, 1500, itd." }