Skip to content

Commit

Permalink
Merge branch 'master' into add-more-translations
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Apr 12, 2021
2 parents 03bd94a + de54c67 commit dc376c4
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 21 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/configs/config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions src/configs/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"title": "MapJS",
"headerTitle": "MapJS - NodeJS Map Replacement",
"locale": "en",
"dateTimeLocale": "en-US",
"style": "dark",
"dbType": "rdm",
"searchMaxResults": 20,
Expand Down
1 change: 1 addition & 0 deletions src/data/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/services/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion src/views/index.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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}}};
Expand Down Expand Up @@ -889,7 +890,7 @@
<div id="search-nest-list" class="search-list"></div>
</div>
<div class="tab-pane fade" id="pills-portal" role="tabpanel" aria-labelledby="pills-portal-tab">
<input id="search-portal" type="text" class="form-control" placeholder="{{enter_nest_name}}" autocomplete="off" />
<input id="search-portal" type="text" class="form-control" placeholder="{{enter_portal_name}}" autocomplete="off" />
<div id="search-portal-list" class="search-list"></div>
</div>
<div class="tab-pane fade" id="pills-gym" role="tabpanel" aria-labelledby="pills-gym-tab">
Expand Down
28 changes: 14 additions & 14 deletions static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3182,7 +3182,7 @@ const getPokemonPopupContent = (pokemon) => {
</div>
<table class="pokemon-despawn-timers-min">
<tr>
<td>${despawnDate.toLocaleTimeString()}</td>
<td>${despawnDate.toLocaleTimeString(dateTimeLocale)}</td>
</tr>
<tr>
<td>${pokemon.expire_timestamp_verified ? '<i class="fa fa-check" aria-hidden="true"></i>' : '<i class="fas fa-question" aria-hidden="true"></i>'} ${getTimeUntil(despawnDate)}</td>
Expand All @@ -3196,7 +3196,7 @@ const getPokemonPopupContent = (pokemon) => {
<tr>
<td><b>${i18n('popup_despawn')}:</b></td>
<tr>
<td>${despawnDate.toLocaleTimeString()}</td>
<td>${despawnDate.toLocaleTimeString(dateTimeLocale)}</td>
</tr>
<tr>
<td>${pokemon.expire_timestamp_verified ? '<i class="fa fa-check" aria-hidden="true"></i>' : '<i class="fas fa-question" aria-hidden="true"></i>'} ${getTimeUntil(despawnDate)}</td>
Expand All @@ -3219,11 +3219,11 @@ const getPokemonPopupContent = (pokemon) => {
</tr>`;
if (pokemon.first_seen_timestamp) {
const firstSeenDate = new Date(pokemon.first_seen_timestamp * 1000);
content += `<tr><td>${firstSeenDate.toLocaleTimeString()}</td></tr>`;
content += `<tr><td>${firstSeenDate.toLocaleTimeString(dateTimeLocale)}</td></tr>`;
}
if (pokemon.updated !== 0 && pokemon.updated !== null) {
const updatedDate = new Date(pokemon.updated * 1000);
content += `<tr><td>${updatedDate.toLocaleTimeString()}</td></tr>`;
content += `<tr><td>${updatedDate.toLocaleTimeString(dateTimeLocale)}</td></tr>`;
}
return content += `</table></div>`;
}
Expand Down Expand Up @@ -3435,15 +3435,15 @@ function getPokestopPopupContent (pokestop) {

if (isActiveLure) {
content += `<b>${i18n('popup_lure_type')}:</b> ${getLureName(pokestop.lure_id)}<br>`;
content += `<b>${i18n('popup_lure_end_time')}:</b> ${lureExpireDate.toLocaleTimeString()} (${getTimeUntil(lureExpireDate)})<br><br>`;
content += `<b>${i18n('popup_lure_end_time')}:</b> ${lureExpireDate.toLocaleTimeString(dateTimeLocale)} (${getTimeUntil(lureExpireDate)})<br><br>`;
}

if (invasionExpireDate >= now) {
const gruntType = getGruntName(pokestop.grunt_type);
content += `<center>
<b>${i18n('popup_team_rocket_invasion')}</b><br>
${gruntType}<br>
<b>${i18n('popup_end_time')}:</b> ${invasionExpireDate.toLocaleTimeString()} (${getTimeUntil(invasionExpireDate)})</center>`;
<b>${i18n('popup_end_time')}:</b> ${invasionExpireDate.toLocaleTimeString(dateTimeLocale)} (${getTimeUntil(invasionExpireDate)})</center>`;
content += getPossibleInvasionRewards(pokestop);
}

Expand Down Expand Up @@ -3478,7 +3478,7 @@ function getPokestopPopupContent (pokestop) {

const updatedDate = new Date(pokestop.updated * 1000);
if (updatedDate) {
content += `<div class="last-updated"><b>${i18n('popup_last_updated')}:</b> ${updatedDate.toLocaleDateString()} ${updatedDate.toLocaleTimeString()}</div>`;
content += `<div class="last-updated"><b>${i18n('popup_last_updated')}:</b> ${updatedDate.toLocaleDateString(dateTimeLocale)} ${updatedDate.toLocaleTimeString()}</div>`;
}

const questReward = pokestop.quest_rewards ? pokestop.quest_rewards[0] : {};
Expand Down Expand Up @@ -3698,10 +3698,10 @@ function getGymPopupContent (gym) {

content += '<div class="text-center">';
if (isRaid && !isRaidBattle) {
content += `<b>${i18n('popup_raid_start')}:</b> ` + raidBattleDate.toLocaleTimeString() + ' (' + getTimeUntil(raidBattleDate) + ')<br>';
content += `<b>${i18n('popup_raid_start')}:</b> ` + raidBattleDate.toLocaleTimeString(dateTimeLocale) + ' (' + getTimeUntil(raidBattleDate) + ')<br>';
}
if (isRaid) {
content += `<b>${i18n('popup_raid_end')}:</b> ${raidEndDate.toLocaleTimeString()} (${getTimeUntil(raidEndDate)})<br>`;
content += `<b>${i18n('popup_raid_end')}:</b> ${raidEndDate.toLocaleTimeString(dateTimeLocale)} (${getTimeUntil(raidEndDate)})<br>`;
if (gym.raid_pokemon_id > 0) {
content += `<b>${i18n('popup_perfect_cp')}:</b> ${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)}<br>`;
content += `<b>${i18n('popup_worst_cp')}:</b> ${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)}<br><br>`;
Expand All @@ -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 += `<div class="last-updated"><b>${i18n('popup_last_updated')}:</b> ${updatedDate.toLocaleDateString()} ${updatedDate.toLocaleTimeString()} (${getTimeSince(updatedDate)})<br></div>`;
content += `<div class="last-updated"><b>${i18n('popup_last_updated')}:</b> ${updatedDate.toLocaleDateString(dateTimeLocale)} ${updatedDate.toLocaleTimeString(dateTimeLocale)} (${getTimeSince(updatedDate)})<br></div>`;
}
if (modifiedDate) {
content += `<div class="last-updated"><b>${i18n('popup_last_modified')}:</b> ${modifiedDate.toLocaleDateString()} ${modifiedDate.toLocaleTimeString()} (${getTimeSince(modifiedDate)})<br></div>`;
content += `<div class="last-updated"><b>${i18n('popup_last_modified')}:</b> ${modifiedDate.toLocaleDateString(dateTimeLocale)} ${modifiedDate.toLocaleTimeString(dateTimeLocale)} (${getTimeSince(modifiedDate)})<br></div>`;
}
content += getNavigation(gym);
return content;
Expand All @@ -3733,7 +3733,7 @@ function getCellPopupContent (cell) {

const updatedDate = new Date(cell.updated * 1000);

content += `<b>${i18n('popup_last_updated')}:</b> ${updatedDate.toLocaleTimeString()} (${getTimeSince(updatedDate)})`;
content += `<b>${i18n('popup_last_updated')}:</b> ${updatedDate.toLocaleTimeString(dateTimeLocale)} (${getTimeSince(updatedDate)})`;
content += '</center>';
return content;
}
Expand Down Expand Up @@ -3798,7 +3798,7 @@ function getWeatherPopupContent (weather) {
<b>${i18n('popup_boosted')}:</b><br>${weatherType.join(', ')}<br>
${weatherTypeIcons.join(' ')}<br>
${extraContent}
<b>${i18n('popup_last_updated')}:</b> ${updatedDate.toLocaleTimeString()} (${getTimeSince(updatedDate)})
<b>${i18n('popup_last_updated')}:</b> ${updatedDate.toLocaleTimeString(dateTimeLocale)} (${getTimeSince(updatedDate)})
</center>`;
return content;
}
Expand Down Expand Up @@ -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 = `<center><h6><b>${device.uuid}</b></h6></center><br>
Expand Down
12 changes: 9 additions & 3 deletions static/locales/_pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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."
}

0 comments on commit dc376c4

Please sign in to comment.