Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lang tags for collections\map\mapbox.php #1144

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 31 additions & 28 deletions collections/map/mapbox.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
include_once('../../config/symbini.php');
include_once($SERVER_ROOT.'/classes/OccurrenceMapManager.php');
if($LANG_TAG != 'en' && file_exists($SERVER_ROOT.'/content/lang/collections/map/mapbox.' . $LANG_TAG . '.php')) include_once($SERVER_ROOT.'/content/lang/collections/map/mapbox.' . $LANG_TAG . '.php');
else include_once($SERVER_ROOT . '/content/lang/collections/map/mapbox.en.php');

header("Content-Type: text/html; charset=".$CHARSET);

$clid = array_key_exists('clid',$_REQUEST)?$_REQUEST['clid']:0;
Expand Down Expand Up @@ -36,7 +39,7 @@
<!DOCTYPE html>
<html lang="<?php echo $LANG_TAG ?>">
<head>
<title><?php echo $DEFAULT_TITLE; ?> - Taxon Map</title>
<title><?php echo $DEFAULT_TITLE; ?> - <?php echo $LANG['TAXON_MAP']; ?></title>
<?php
include_once($SERVER_ROOT.'/includes/head.php');
?>
Expand Down Expand Up @@ -78,11 +81,11 @@ function addRefPoint(){
}
if(lat != null && lng != null){
if(lat < -180 || lat > 180 || lng < -180 || lng > 180){
window.alert("Latitude and Longitude must be of values between -180 and 180 (" + lat + ";" + lng + ")");
window.alert("<?php echo $LANG['LAT_LONG_VALUES']; ?> (" + lat + ";" + lng + ")");
}
else{
var addPoint = true;
if(lng > 0) addPoint = window.confirm("Longitude is positive, which will put the marker in the eastern hemisphere (e.g. Asia).\nIs this what you want?");
if(lng > 0) addPoint = window.confirm("<?php echo $LANG['LONGITUDE_IS_POSITIVE']; ?>?");
if(!addPoint) lng = -1*lng;

var iconImg = new google.maps.MarkerImage( '../../images/google/arrow.png' );
Expand All @@ -97,7 +100,7 @@ function addRefPoint(){
}
}
else{
window.alert("Enter values in the latitude and longitude fields");
window.alert("<?php echo $LANG['ENTER_VALUES_IN_LAT_LONG']; ?>");
}
}

Expand Down Expand Up @@ -125,36 +128,36 @@ function toggleLatLongDivs(){
if(!$coordArr){
?>
<div style="font-size:120%;font-weight:bold;">
Your query apparently does not contain any records with coordinates that can be mapped.
<?php echo $LANG['QUERY_DOES_NOT_CONTAIN_RECORDS']; ?>.
</div>
<div style="margin-left:20px;">
Either the records in the query are not georeferenced (no lat/long)<br/>
<?php echo $LANG['EITHER_REC_NOT_GEOREF']; ?><br/><br/>
</div>
<div style="margin-left:100px;">
-or-
-<?php echo $LANG['OR']; ?>-
</div>
<div style="margin-left:20px;">
Rare/threatened status requires the locality coordinates be hidden.
<?php echo $LANG['RARE_STATUS_REQUIRES']; ?>.
</div>
<?php
}
?>
<div id="mapid"></div>

<table title='Add Point of Reference' style="width:100%;" >
<table title='<?php echo $LANG['ADD_POINT_REF']; ?>' style="width:100%;" >
<tr>
<td style="width:330px" valign='top'>
<fieldset>
<legend>Legend</legend>
<legend><?php echo $LANG['LEGEND']; ?></legend>
<div style="float:left;">
<?php
foreach($colorKey as $iconKey => $colorCode){
echo '<div>';
echo '<svg xmlns="http://www.w3.org/2000/svg" style="height:12px;width:12px;margin-bottom:-2px;"><g><rect x="1" y="1" width="11" height="10" fill="#'.$colorCode.'" stroke="#000000" stroke-width="1px" /></g></svg> ';
if(!$iconKey) echo '= various taxa';
if(!$iconKey) echo '= ' . $LANG['VARIOUS_TAXA'] . '';
RamisaZaman marked this conversation as resolved.
Show resolved Hide resolved
elseif(is_numeric($iconKey)) echo '= <i>'.$taxaKey[$iconKey]['str'].'</i>';
elseif(isset($taxaKey['orphan'][$iconKey])) echo '= <i>'.$iconKey.'</i>';
else echo '= various taxa';
else echo '= ' . $LANG['VARIOUS_TAXA'] . '';
RamisaZaman marked this conversation as resolved.
Show resolved Hide resolved
echo '</div>';
}
?>
Expand All @@ -165,66 +168,66 @@ function toggleLatLongDivs(){
<g>
<circle cx="7.5" cy="7.5" r="7" fill="white" stroke="#000000" stroke-width="1px" ></circle>
</g>
</svg> = Collection
</svg> = <?php echo $LANG['COLLECTION']; ?>
</div>
<div>
<svg style="height:14px;width:14px;margin-bottom:-2px;">" xmlns="http://www.w3.org/2000/svg">
<g>
<path stroke="#000000" d="m6.70496,0.23296l-6.70496,13.48356l13.88754,0.12255l-7.18258,-13.60611z" stroke-width="1px" fill="white"/>
</g>
</svg> = Observation
</svg> = <?php echo $LANG['OBSERVATION']; ?>
</div>
</div>
</fieldset>
</td>
<td style="width:375px;" valign='top'>
<div>
<fieldset>
<legend>Add Point of Reference</legend>
<legend><?php echo $LANG['ADD_POINT_REF']; ?></legend>
<div style='float:left;width:350px;'>
<div class="latlongdiv">
<div>
Latitude decimal: <input name='lat' id='lat' size='10' type='text' /> eg: 34.57
<?php echo $LANG['LAT_DEC']; ?>: <input name='lat' id='lat' size='10' type='text' /> eg: 34.57
</div>
<div style="margin-top:5px;">
Longitude decimal: <input name='lng' id='lng' size='10' type='text' /> eg: -112.38
<?php echo $LANG['LONG_DEC']; ?>: <input name='lng' id='lng' size='10' type='text' /> eg: -112.38
</div>
<div style='font-size:80%;margin-top:5px;'>
<a href='#' onclick='toggleLatLongDivs();'>Enter in D:M:S format</a>
<a href='#' onclick='toggleLatLongDivs();'><?php echo $LANG['ENTER_IN_DMS_FORMAT']; ?></a>
</div>
</div>
<div class='latlongdiv' style='display:none;'>
<div>
Latitude:
<?php echo $LANG['LAT']; ?>:
<input name='latdeg' id='latdeg' size='2' type='text' />&deg;
<input name='latmin' id='latmin' size='5' type='text' />&prime;
<input name='latsec' id='latsec' size='5' type='text' />&Prime;
<select name='latns' id='latns'>
<option value='N'>N</option>
<option value='S'>S</option>
<option value='N'><?php echo $LANG['NORTH']; ?></option>
<option value='S'><?php echo $LANG['SOUTH']; ?></option>
</select>
</div>
<div style="margin-top:5px;">
Longitude:
<?php echo $LANG['LONG']; ?>:
<input name='longdeg' id='longdeg' size='2' type='text' />&deg;
<input name='longmin' id='longmin' size='5' type='text' />&prime;
<input name='longsec' id='longsec' size='5' type='text' />&Prime;
<select name='longew' id='longew'>
<option value='E'>E</option>
<option value='W' selected>W</option>
<option value='E'><?php echo $LANG['EAST']; ?></option>
<option value='W' selected><?php echo $LANG['WEST']; ?></option>
</select>
</div>
<div style='font-size:80%;margin-top:5px;'>
<a href='#' onclick='toggleLatLongDivs();'>Enter in Decimal format</a>
<a href='#' onclick='toggleLatLongDivs();'><?php echo $LANG['ENTER_IN_DEC_FORMAT']; ?></a>
</div>
</div>
</div>
<div style="float:right;width:100px;">
<div style="float:right;">
Marker Name: <input name='title' id='title' size='20' type='text' />
<?php echo $LANG['MARKER_NAME']; ?>: <input name='title' id='title' size='20' type='text' />
</div><br />
<div style="float:right;margin-top:10px;">
<input type='submit' value='Add Marker' onclick='addRefPoint();' />
<button type='submit' value='Add Marker' onclick='addRefPoint();' ><?php echo $LANG['ADD_MARKER']; ?></button>
</div>
</div>
</fieldset>
Expand Down Expand Up @@ -257,7 +260,7 @@ function toggleLatLongDivs(){
var mapObj = L.map('mapid').setView([<?php echo $latCen.','.$longCen; ?>], 3);

L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=<?php echo (isset($MAPBOX_API_KEY) && $MAPBOX_API_KEY?$MAPBOX_API_KEY:''); ?>', {
attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
attribution: '<?php echo $LANG['MAP_DATA']; ?> &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> <?php echo $LANG['CONTRIBUTORS']; ?>, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, <?php echo $LANG['IMAGERY']; ?> © <a href="https://www.mapbox.com/">Mapbox</a>',
minZoom: 1,
maxZoom: 18,
id: 'taxon/streets-v11',
Expand Down
40 changes: 40 additions & 0 deletions content/lang/collections/map/mapbox.en.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/*
------------------
Language: English
------------------
*/

$LANG['TAXON_MAP'] = 'Taxon Map';

$LANG['LAT_LONG_VALUES'] = 'Latitude and Longitude must be of values between -180 and 180';
$LANG['LONGITUDE_IS_POSITIVE'] = 'Longitude is positive, which will put the marker in the eastern hemisphere (e.g. Asia).\nIs this what you want';
$LANG['ENTER_VALUES_IN_LAT_LONG'] = 'Enter values in the latitude and longitude fields';
$LANG['QUERY_DOES_NOT_CONTAIN_RECORDS'] = 'Your query apparently does not contain any records with coordinates that can be mapped';
$LANG['EITHER_REC_NOT_GEOREF'] = 'Either the records in the query are not georeferenced (no lat/long)';
$LANG['OR'] = 'or';
$LANG['RARE_STATUS_REQUIRES'] = 'Rare/threatened status requires the locality coordinates be hidden';
$LANG['NORTH'] = 'N';
$LANG['SOUTH'] = 'S';
$LANG['EAST'] = 'E';
$LANG['WEST'] = 'W';

$LANG['ADD_POINT_REF'] = 'Add Point of Reference';
$LANG['LEGEND'] = 'Legend';
$LANG['VARIOUS_TAXA'] = 'various taxa';
$LANG['COLLECTION'] = 'Collection';
$LANG['OBSERVATION'] = 'Observation';
$LANG['LAT_DEC'] = 'Latitude decimal';
$LANG['LONG_DEC'] = 'Longitude decimal';
$LANG['ENTER_IN_DMS_FORMAT'] = 'Enter in D:M:S format';
$LANG['LAT'] = 'Latitude';
$LANG['LONG'] = 'Longitude';
$LANG['ENTER_IN_DEC_FORMAT'] = 'Enter in Decimal format';
$LANG['MARKER_NAME'] = 'Marker Name';
$LANG['ADD_MARKER'] = 'Add Marker';
$LANG['MAP_DATA'] = 'Map data';
$LANG['CONTRIBUTORS'] = 'contributors';
$LANG['IMAGERY'] = 'Imagery';


?>
41 changes: 41 additions & 0 deletions content/lang/collections/map/mapbox.es.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/*
------------------
Language: Español (Spanish)
Translated by: Google Translate
Date Translated: 2024/04/11
------------------
*/

$LANG['TAXON_MAP'] = 'Mapa de Taxones';

$LANG['LAT_LONG_VALUES'] = 'Latitud y Longitud deben tener valores entre -180 y 180';
$LANG['LONGITUDE_IS_POSITIVE'] = 'La Longitud es positiva, lo que colocará el marcador en el hemisferio oriental (por ejemplo, Asia).\n¿Es esto lo que quieres?';
$LANG['ENTER_VALUES_IN_LAT_LONG'] = 'Ingrese valores en los campos de latitud y longitud';
$LANG['QUERY_DOES_NOT_CONTAIN_RECORDS'] = 'Su consulta aparentemente no contiene ningún registro con coordenadas que puedan mapearse';
$LANG['EITHER_REC_NOT_GEOREF'] = 'O los registros en la consulta no están georreferenciados (sin latitud/longitud)';
$LANG['OR'] = 'o';
$LANG['RARE_STATUS_REQUIRES'] = 'El estado raro/amenazado requiere que las coordenadas de la localidad estén ocultas';
$LANG['NORTH'] = 'N';
$LANG['SOUTH'] = 'S';
$LANG['EAST'] = 'E';
$LANG['WEST'] = 'W';

$LANG['ADD_POINT_REF'] = 'Agregar punto de Referencia';
$LANG['LEGEND'] = 'Leyenda';
$LANG['VARIOUS_TAXA'] = 'varios taxones';
$LANG['COLLECTION'] = 'Colección';
$LANG['OBSERVATION'] = 'Observación';
$LANG['LAT_DEC'] = 'Latitud decimal';
$LANG['LONG_DEC'] = 'Longitud decimal';
$LANG['ENTER_IN_DMS_FORMAT'] = 'Ingresar en formato D:M:S';
$LANG['LAT'] = 'Latitud';
$LANG['LONG'] = 'Longitud';
$LANG['ENTER_IN_DEC_FORMAT'] = 'Ingresar en formato decimal';
$LANG['MARKER_NAME'] = 'Nombre del Marcador';
$LANG['ADD_MARKER'] = 'Agregar Marcador';
$LANG['MAP_DATA'] = 'Datos del Mapa';
$LANG['CONTRIBUTORS'] = 'colaboradores';
$LANG['IMAGERY'] = 'Imágenes';

?>
41 changes: 41 additions & 0 deletions content/lang/collections/map/mapbox.fr.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/*
------------------
Language: Français (French)
Translated by: Google Translate
Date Translated: 2024/04/11
------------------
*/

$LANG['TAXON_MAP'] = 'Carte des Taxons';

$LANG['LAT_LONG_VALUES'] = 'Latitude et Longitude doivent avoir des valeurs comprises entre -180 et 180';
$LANG['LONGITUDE_IS_POSITIVE'] = 'La Longitude est positive, ce qui placera le marqueur dans l\'hémisphère oriental (par exemple l\'Asie).\nEst-ce ce que vous voulez';
$LANG['ENTER_VALUES_IN_LAT_LONG'] = 'Entrez les valeurs dans les champs de latitude et de longitude';
$LANG['QUERY_DOES_NOT_CONTAIN_RECORDS'] = 'Votre requête ne contient apparemment aucun enregistrement avec des coordonnées pouvant être cartographiées';
$LANG['EITHER_REC_NOT_GEOREF'] = 'Soit les enregistrements de la requête ne sont pas géoréférencés (pas de latitude/longitude)';
$LANG['OU'] = 'ou';
$LANG['RARE_STATUS_REQUIRES'] = 'Le statut rare/menacé nécessite que les coordonnées de la localité soient masquées';
$LANG['NORTH'] = 'N';
$LANG['SOUTH'] = 'S';
$LANG['EAST'] = 'E';
$LANG['WEST'] = 'W';

$LANG['ADD_POINT_REF'] = 'Ajouter un point de Référence';
$LANG['LEGEND'] = 'Légende';
$LANG['VARIOUS_TAXA'] = 'divers taxons';
$LANG['COLLECTION'] = 'Collection';
$LANG['OBSERVATION'] = 'Observation';
$LANG['LAT_DEC'] = 'Latitude décimale';
$LANG['LONG_DEC'] = 'Longitude décimale';
$LANG['ENTER_IN_DMS_FORMAT'] = 'Entrez au format D:M:S';
$LANG['LAT'] = 'Latitude';
$LANG['LONG'] = 'Longitude';
$LANG['ENTER_IN_DEC_FORMAT'] = 'Entrez au format décimal';
$LANG['MARKER_NAME'] = 'Nom du Marqueur';
$LANG['ADD_MARKER'] = 'Ajouter un Marqueur';
$LANG['MAP_DATA'] = 'Données Cartographiques';
$LANG['CONTRIBUTORS'] = 'contributeurs';
$LANG['IMAGERY'] = 'Imagerie';

?>