예제 #1
0
파일: example.php 프로젝트: rasismeiro/I18N
<?php

require dirname(__FILE__) . '/I18N.php';
I18N::instance('pt_PT');
?>
<!doctype html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>translate test...</title>
	</head>
	<body>
	<?php 
echo I18N::translate("I hope it's useful for someone");
?>
	</body>
</html>
예제 #2
0
             if ($event_jd) {
                 // Exclude individuals who were born after the event.
                 $person_birth_jd = $person->getEstimatedBirthDate()->minimumJulianDay();
                 if ($person_birth_jd && $person_birth_jd > $event_jd) {
                     continue;
                 }
                 // Exclude individuals who died before the event.
                 $person_death_jd = $person->getEstimatedDeathDate()->maximumJulianDay();
                 if ($person_death_jd && $person_death_jd < $event_jd) {
                     continue;
                 }
             }
             // Add the age (if we have it) or the lifespan (if we do not).
             $label = $person->getFullName();
             if ($event_jd && $person->getBirthDate()->isOK()) {
                 $label .= ', <span class="age">(' . I18N::translate('Age') . ' ' . Date::getAge($person->getBirthDate(), $date, 0) . ')</span>';
             } else {
                 $label .= ', <i>' . $person->getLifeSpan() . '</i>';
             }
             $data[$row->xref] = array('value' => $row->xref, 'label' => $label);
         }
     }
     echo json_encode($data);
     return;
 case 'CEME':
     // Cemetery fields, that contain the search term
     $data = array();
     // Fetch all data, regardless of privacy
     $rows = Database::prepare("SELECT SQL_CACHE i_id AS xref, i_gedcom AS gedcom" . " FROM `##individuals`" . " WHERE i_gedcom LIKE '%\n2 CEME %' AND i_file = :tree_id" . " ORDER BY SUBSTRING_INDEX(i_gedcom, '\n2 CEME ', -1) COLLATE :collation")->execute(array('tree_id' => $WT_TREE->getTreeId(), 'collation' => I18N::collation()))->fetchAll();
     // Filter for privacy
     foreach ($rows as $row) {
예제 #3
0
define('WT_MODULES_DIR', 'modules_v3/');
Session::start();
define('WT_LOCALE', I18N::init());
if (file_exists(WT_DATA_DIR . 'offline.txt')) {
    $offline_txt = file_get_contents(WT_DATA_DIR . 'offline.txt');
} else {
    // offline.txt has gone - we're back online!
    header('Location: index.php');
    return;
}
http_response_code(503);
header('Content-Type: text/html; charset=UTF-8');
echo '<!DOCTYPE html>', '<html ', I18N::htmlAttributes(), '>', '<head>', '<meta charset="UTF-8">', '<title>', WT_WEBTREES, '</title>', '<meta name="robots" content="noindex,follow">', '<style type="text/css">
		body {color: gray; background-color: white; font: 14px tahoma, arial, helvetica, sans-serif; padding:10px; }
		a {color: #81A9CB; font-weight: bold; text-decoration: none;}
		a:hover {text-decoration: underline;}
		h1 {color: #81A9CB; font-weight:normal; text-align:center;}
		li {line-height:2;}
		blockquote {color:red;}
		.content { /*margin:auto; width:800px;*/ border:1px solid gray; padding:15px; border-radius:15px;}
		.good {color: green;}
	</style>', '</head><body>', '<h1>', I18N::translate('This website is temporarily unavailable'), '</h1>', '<div class="content"><p>';
if ($offline_txt) {
    echo $offline_txt;
} else {
    echo I18N::translate('This website is down for maintenance.  You should <a href="index.php">try again</a> in a few minutes.');
}
echo '</p>';
echo '</div>';
echo '</body>';
echo '</html>';
function i($key, $args = array())
{
    return I18N::translate($key, $args);
}
예제 #5
0
echo I18N::translate('Search');
?>
							</a>
						</td>
					</tr>
					<tr>
						<td align="center">
							<table width="100%" class="fact_table" cellspacing="0" border="0">
								<tr>
									<td align="center" colspan=3 class="descriptionbox wrap">
										<?php 
echo I18N::translate('Click %s to choose individual as head of family.', '<i class="headimg vmiddle icon-button_head"></i>');
?>
										<br><br>
										<?php 
echo I18N::translate('Click name to add individual to add links list.');
?>
									</td>
								</tr>
								<?php 
foreach ($person->getChildFamilies() as $family) {
    echo '<tr><th colspan="2">', $family->getFullName(), '</td></tr>';
    print_navigator_family($family, $person);
}
foreach ($person->getChildStepFamilies() as $family) {
    echo '<tr><th colspan="2">', $family->getFullName(), '</td></tr>';
    print_navigator_family($family, $person);
}
foreach ($person->getSpouseFamilies() as $family) {
    echo '<tr><th colspan="2">', $family->getFullName(), '</td></tr>';
    print_navigator_family($family, $person);
예제 #6
0
파일: i18n.php 프로젝트: nedron92/logd-oop
 function __($s_translate_id, $s_section = 'common')
 {
     return I18N::translate($s_translate_id, $s_section);
 }
예제 #7
0
파일: Note.php 프로젝트: tronsmit/webtrees
 /**
  * Create a name for this note - apply (and remove) markup, then take
  * a maximum of 100 characters from the first line.
  */
 public function extractNames()
 {
     $text = $this->getNote();
     if ($text) {
         switch ($this->getTree()->getPreference('FORMAT_TEXT')) {
             case 'markdown':
                 $text = Filter::markdown($text);
                 $text = Filter::unescapeHtml($text);
                 break;
         }
         list($text) = explode("\n", $text);
         $this->addName('NOTE', strlen($text) > 100 ? mb_substr($text, 0, 100) . I18N::translate('…') : $text, $this->getGedcom());
     }
 }
예제 #8
0
 /**
  * Which algorithms are supported.
  *
  * @return string[]
  */
 public static function getAlgorithms()
 {
     return array('std' => I18N::translate('Russell'), 'dm' => I18N::translate('Daitch-Mokotoff'));
 }
예제 #9
0
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
define('WT_SCRIPT_NAME', 'admin_trees_export.php');
require './includes/session.php';
if (Auth::isManager($WT_TREE) && Filter::checkCsrf()) {
    $filename = WT_DATA_DIR . $WT_TREE->getName();
    // Force a ".ged" suffix
    if (strtolower(substr($filename, -4)) != '.ged') {
        $filename .= '.ged';
    }
    try {
        // To avoid partial trees on timeout/diskspace/etc, write to a temporary file first
        $stream = fopen($filename . '.tmp', 'w');
        $WT_TREE->exportGedcom($stream);
        fclose($stream);
        rename($filename . '.tmp', $filename);
        FlashMessages::addMessage(I18N::translate('The family tree has been exported to %s.', Html::filename($filename)), 'success');
    } catch (\ErrorException $ex) {
        FlashMessages::addMessage(I18N::translate('The file %s could not be created.', Html::filename($filename)) . '<hr><samp dir="ltr">' . $ex->getMessage() . '</samp>', 'danger');
    }
}
header('Location: ' . WT_BASE_URL . 'admin_trees_manage.php');
예제 #10
0
							<input id="personid" type="text" value="">
							<a type="submit" onclick="findindi();">
								<?php 
echo I18N::translate('Search');
?>
							</a>
						</td>
					</tr>
					<tr>
						<td>
							<table width="100%" class="fact_table" cellspacing="0" border="0">
								<tr>
									<td colspan=3 class="descriptionbox wrap">
										<i class="headimg vmiddle icon-button_head"></i>
										<?php 
echo I18N::translate('View this family');
?>
									</td>
								</tr>
								<?php 
foreach ($person->getChildFamilies() as $family) {
    echo '<tr><th colspan="2">', $family->getFullName(), '</td></tr>';
    print_navigator_family($family, $person);
}
foreach ($person->getChildStepFamilies() as $family) {
    echo '<tr><th colspan="2">', $family->getFullName(), '</td></tr>';
    print_navigator_family($family, $person);
}
foreach ($person->getSpouseFamilies() as $family) {
    echo '<tr><th colspan="2">', $family->getFullName(), '</td></tr>';
    print_navigator_family($family, $person);
예제 #11
0
function __($key, $params = array(), $reversed = null, $prefix = null)
{
    return I18N::translate($key, $params, $reversed, $prefix);
}
예제 #12
0
             if ($event_jd) {
                 // Exclude individuals who were born after the event.
                 $person_birth_jd = $person->getEstimatedBirthDate()->minimumJulianDay();
                 if ($person_birth_jd && $person_birth_jd > $event_jd) {
                     continue;
                 }
                 // Exclude individuals who died before the event.
                 $person_death_jd = $person->getEstimatedDeathDate()->maximumJulianDay();
                 if ($person_death_jd && $person_death_jd < $event_jd) {
                     continue;
                 }
             }
             // Add the age (if we have it) or the lifespan (if we do not).
             $label = $person->getFullName();
             if ($event_jd && $person->getBirthDate()->isOK()) {
                 $label .= ', <span class="age">(' . I18N::translate('Age') . ' ' . $person->getBirthDate()->minimumDate()->getAge(false, $event_jd) . ')</span>';
             } else {
                 $label .= ', <i>' . $person->getLifeSpan() . '</i>';
             }
             $data[$row->xref] = array('value' => $row->xref, 'label' => $label);
         }
     }
     echo json_encode($data);
     return;
 case 'CEME':
     // Cemetery fields, that contain the search term
     $data = array();
     // Fetch all data, regardless of privacy
     $rows = Database::prepare("SELECT SQL_CACHE i_id AS xref, i_gedcom AS gedcom" . " FROM `##individuals`" . " WHERE i_gedcom LIKE '%\n2 CEME %' AND i_file = :tree_id" . " ORDER BY SUBSTRING_INDEX(i_gedcom, '\n2 CEME ', -1) COLLATE :collation")->execute(array('tree_id' => $WT_TREE->getTreeId(), 'collation' => I18N::collation()))->fetchAll();
     // Filter for privacy
     foreach ($rows as $row) {
예제 #13
0
파일: framework.php 프로젝트: rudenyl/kcms
/**
Print internationalized texts
	@param $text string
	@public
**/
function __e($text)
{
    // get params
    $args = func_get_args();
    $text = I18N::translate($text, $args);
    // strip slashes
    $text = stripslashes($text);
    return $text;
}
예제 #14
0
        $title = I18N::translate('Year input box');
        $text = I18N::translate('This input box lets you change that year of the calendar. Type a year into the box and press <b>Enter</b> to change the calendar to that year.<br><br><b>Advanced features</b> for <b>View the year</b><dl><dt><b>More than one year</b></dt><dd>You can search for dates in a range of years.<br><br>Year ranges are <u>inclusive</u>. This means that the date range extends from 1 January of the first year of the range to 31 December of the last year mentioned. Here are a few examples of year ranges:<br><br><b>1992-5</b> for all events from 1992 to 1995.<br><b>1972-89</b> for all events from 1972 to 1989.<br><b>1610-759</b> for all events from 1610 to 1759.<br><b>1880-1905</b> for all events from 1880 to 1905.<br><b>880-1105</b> for all events from 880 to 1105.<br><br>To see all the events in a given decade or century, you can use <b>?</b> in place of the final digits. For example, <b>197?</b> for all events from 1970 to 1979 or <b>16??</b> for all events from 1600 to 1699.<br><br>Selecting a range of years will change the calendar to the year view.</dd></dl>');
        break;
    case 'edit_edit_raw':
        $title = I18N::translate('Edit the raw GEDCOM');
        $text = I18N::translate('This page allows you to bypass the usual forms, and edit the underlying data directly. It is an advanced option, and you should not use it unless you understand the GEDCOM format. If you make a mistake here, it can be difficult to fix.') . '<br><br>' . I18N::translate('You can download a copy of the GEDCOM specification from %s.', '<a href="https://wiki.webtrees.net/w/images-en/Ged551-5.pdf">https://wiki.webtrees.net/w/images-en/Ged551-5.pdf</a>');
        break;
    case 'edit_SOUR_EVEN':
        $title = I18N::translate('Associate events with this source');
        $text = I18N::translate('Each source records specific events, generally for a given date range and for a place jurisdiction. For example a Census records census events and church records record birth, marriage, and death events.<br><br>Select the events that are recorded by this source from the list of events provided. The date should be specified in a range format such as <i>FROM 1900 TO 1910</i>. The place jurisdiction is the name of the lowest jurisdiction that encompasses all lower-level places named in this source. For example, “Oneida, Idaho, USA” would be used as a source jurisdiction place for events occurring in the various towns within Oneida County. “Idaho, USA” would be the source jurisdiction place if the events recorded took place not only in Oneida County but also in other counties in Idaho.');
        break;
    case 'google_chart_surname':
        $title = I18N::translate('Surname');
        $text = I18N::translate('The number of occurrences of the specified name will be shown on the map. If you leave this field empty, the most common surname will be used.');
        break;
    case 'pending_changes':
        $title = I18N::translate('Pending changes');
        $text = '<p>' . I18N::translate('When you add, edit, or delete information, the changes are not saved immediately. Instead, they are kept in a “pending” area. These pending changes need to be reviewed by a moderator before they are accepted.') . '</p><p>' . I18N::translate('This process allows the site’s owner to ensure that the new information follows the site’s standards and conventions, has proper source attributions, etc.') . '</p><p>' . I18N::translate('Pending changes are only shown when your account has permission to edit. When you sign out, you will no longer be able to see them. Also, pending changes are only shown on certain pages. For example, they are not shown in lists, reports, or search results.') . '</p>';
        if (Auth::isAdmin()) {
            $text .= '<p>' . I18N::translate('Each user account has an option to “automatically accept changes”. When this is enabled, any changes made by that user are saved immediately. Many administrators enable this for their own user account.') . '</p>';
        }
        break;
    default:
        $title = I18N::translate('Help');
        $text = I18N::translate('The help text has not been written for this item.');
        break;
}
// This file is called by a getJSON call so return the data
// in correct format
header('Content-Type: application/json');
echo json_encode(array('title' => $title, 'content' => $text));
예제 #15
0
 /**
  * Returns the changeset as plain text.
  *
  * @param $found_facts
  * @return string
  */
 public function getRecentChangesAsHtml()
 {
     // TODO: Refactor this code taken from RecentChangesModule.
     global $WT_TREE;
     $sort = "date_desc";
     $found_facts = $this->getRecentChanges();
     $n = 0;
     $arr = array();
     foreach ($found_facts as $change_id) {
         $record = GedcomRecord::getInstance($change_id, $WT_TREE);
         if (!$record || !$record->canShow()) {
             continue;
         }
         // setup sorting parameters
         $arr[$n]['record'] = $record;
         $arr[$n]['jd'] = $sort == 'name' ? 1 : $n;
         $arr[$n]['anniv'] = $record->lastChangeTimestamp(true);
         $arr[$n++]['fact'] = $record->getSortName();
         // in case two changes have same timestamp
     }
     uasort($arr, '\\Fisharebest\\Webtrees\\Functions\\Functions::eventSort');
     $arr = array_reverse($arr);
     $mailtext = '';
     foreach ($arr as $value) {
         $mailtext .= '<a href="' . $value['record']->getHtmlUrl() . '" class="list_item name2">' . $value['record']->getFullName() . '</a>';
         $mailtext .= '<div class="indent" style="margin-bottom: 5px;">';
         if ($value['record'] instanceof Individual) {
             if ($value['record']->getAddName()) {
                 $mailtext .= '<a href="' . $value['record']->getHtmlUrl() . '" class="list_item">' . $value['record']->getAddName() . '</a>';
             }
         }
         $mailtext .= I18N::translate('Changed on %1$s by %2$s', $value['record']->lastChangeTimestamp(), Filter::escapeHtml($value['record']->lastChangeUser()));
         $mailtext .= '</div>';
     }
     return $mailtext;
 }
예제 #16
0
 /**
  * Format this place for display on screen.
  *
  * @return string
  */
 public function getPlaceName()
 {
     $place = reset($this->gedcom_place);
     return $place ? '<span dir="auto">' . Filter::escapeHtml($place) . '</span>' : I18N::translate('unknown');
 }
예제 #17
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

/** @global Controller\SimpleController $controller */
global $controller;
/** @global Tree $WT_TREE */
global $WT_TREE;
if (!Filter::checkCsrf()) {
    require WT_ROOT . WT_MODULES_DIR . 'GEDFact_assistant/census/census-edit.php';
    return;
}
$controller->setPageTitle(I18N::translate('Create a new shared note using assistant'))->pageHeader();
echo '<div id="edit_interface-page">';
echo '<h4>', $controller->getPageTitle(), '</h4>';
$newgedrec = "0 @XREF@ NOTE\n";
if (isset($_REQUEST['EVEN'])) {
    $EVEN = $_REQUEST['EVEN'];
}
if (!empty($EVEN) && count($EVEN) > 0) {
    $newgedrec .= "1 DATA\n";
    $newgedrec .= "2 EVEN " . implode(",", $EVEN) . "\n";
    if (!empty($EVEN_DATE)) {
        $newgedrec .= "3 DATE " . $EVEN_DATE . "\n";
    }
    if (!empty($EVEN_PLAC)) {
        $newgedrec .= "3 PLAC " . $EVEN_PLAC . "\n";
    }
예제 #18
0
 /**
  * Generate a private version of this record
  *
  * @param int $access_level
  *
  * @return string
  */
 protected function createPrivateGedcomRecord($access_level)
 {
     return '0 @' . $this->xref . "@ REPO\n1 NAME " . I18N::translate('Private');
 }
예제 #19
0
<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2016 webtrees development team
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

define('WT_SCRIPT_NAME', 'logout.php');
require './includes/session.php';
if (Auth::id()) {
    Log::addAuthenticationLog('Logout: ' . Auth::user()->getUserName() . '/' . Auth::user()->getRealName());
    Auth::logout();
    FlashMessages::addMessage(I18N::translate('You are logged out.'), 'info');
}
header('Location: ' . WT_BASE_URL);
예제 #20
0
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

/** @global Controller\SimpleController $controller */
global $controller;
/** @global Tree $WT_TREE */
global $WT_TREE;
if (!Filter::checkCsrf()) {
    require WT_ROOT . WT_MODULES_DIR . 'GEDFact_assistant/census/census-edit.php';
    return;
}
// We are creating a CENS/NOTE record linked to these individuals
$pid_array = Filter::post('pid_array');
if (empty($pid_array)) {
    $xref = '';
} else {
    $NOTE = Filter::post('NOTE');
    $gedcom = '0 @XREF@ NOTE ' . preg_replace('/\\r?\\n/', "\n1 CONT ", trim($NOTE));
    $xref = $WT_TREE->createRecord($gedcom)->getXref();
}
$controller->addInlineJavascript('window.opener.set_pid_array("' . $pid_array . '");')->addInlineJavascript('openerpasteid("' . $xref . '");')->setPageTitle(I18N::translate('Create a shared note using the census assistant'))->pageHeader();
?>

<div id="edit_interface-page">
	<h4><?php 
echo $controller->getPageTitle();
?>
</h4>
</div>
<?php 
예제 #21
0
<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2016 webtrees development team
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

define('WT_SCRIPT_NAME', 'logout.php');
require './includes/session.php';
// The current tree (if any).
$gedcom = Session::get('GEDCOM', '');
if (Auth::id()) {
    Log::addAuthenticationLog('Logout: ' . Auth::user()->getUserName() . '/' . Auth::user()->getRealName());
    Auth::logout();
    FlashMessages::addMessage(I18N::translate('You have signed out.'), 'info');
}
header('Location: ' . WT_BASE_URL . 'index.php?ged=' . rawurlencode($gedcom));