Skip to content

Commit

Permalink
Created gettext language file for en_US. Pulled out (nearly) all the …
Browse files Browse the repository at this point in the history
…text in the application into the language files.

Fixes #132
Fixes #2
  • Loading branch information
inghamn committed Sep 25, 2013
1 parent 0560636 commit 3fe8a95
Show file tree
Hide file tree
Showing 104 changed files with 2,141 additions and 819 deletions.
24 changes: 12 additions & 12 deletions crm/blocks/html/actions/actionList.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@
<div class="interfaceBox">
<h2><?php
if (userIsAllowed('actions','update')) {
echo '<a class="btn" href="'.BASE_URL.'/actions/update"><span class="icon-plus"></span> Add</a>';
echo sprintf('<a class="btn" href="%s"><span class="icon-plus"></span> %s</a>',
BASE_URI.'/actions/update',
$this->translate('labels.add')
);
}
?>
Actions
</h2>
<table>
<thead>
<tr><th></th>
<th>Action</th>
<th>Description</th>
<th>Type</th>
<th><?php echo $this->translate(array('labels.action', 'labels.actions', 1)); ?></th>
<th><?php echo $this->translate('labels.description'); ?></th>
<th><?php echo $this->translate('labels.type'); ?></th>
</tr>
</thead>
<tbody>
Expand All @@ -28,13 +31,10 @@
foreach ($list as $action) {
$editButton = '';
if (userIsAllowed('actions','update') && $action->getType()!='system') {
$editButton = "
<a class=\"btn\"
href=\"".BASE_URL."/actions/update?action_id={$action->getId()}\">
<span class=\"icon-pencil\"></span>
Edit
</a>
";
$editButton = sprintf('<a class="btn" href="%s"><span class="icon-pencil"></span> %s</a>',
BASE_URI.'/actions/update?action_id='.$action->getId(),
$this->translate('labels.edit')
);
}
$name = View::escape($action->getName());
$description = View::escape($action->getDescription());
Expand All @@ -50,4 +50,4 @@
?>
</tbody>
</table>
</div>
</div>
24 changes: 12 additions & 12 deletions crm/blocks/html/actions/updateActionForm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@
* @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt
* @author Cliff Ingham <inghamn@bloomington.in.gov>
*/
$title = $this->action->getId() ? 'Edit Action' : 'Add Action';
$title = $this->action->getId()
? $this->translate('labels.edit').' '.$this->translate(array('labels.action', 'labels.actions', 1))
: $this->translate('labels.add' ).' '.$this->translate(array('labels.action', 'labels.actions', 1));

$name = View::escape($this->action->getName());
$description = View::escape($this->action->getDescription());
?>
<div class="updateActionForm">
<h2><?php echo $title; ?></h2>
<h3>Description variables</h3>
<p>You can call for data by using these strings inside the description</p>
<p><?php echo $this->translate('text.actions_description'); ?></p>
<table>
<tr><th>{enteredByPerson}</th>
<td>The person who entered the action</td>
<td><?php echo $this->translate('text.actions_enteredByPerson'); ?></td>
</tr>
<tr><th>{actionPerson}</th>
<td>The person the action is about</td>
<td><?php echo $this->translate('text.actions_actionPerson'); ?></td>
</tr>
</table>
<form method="post" action="<?php echo BASE_URL; ?>/actions/update">
Expand All @@ -27,26 +28,25 @@ $description = View::escape($this->action->getDescription());
<table>

<tr><td><label for="name" class="required">
Name
<?php echo $this->translate('labels.name'); ?>
<span class="icon-asterisk"></span>
</label>
</td>
<td><input name="name" id="name" value="<?php echo $name; ?>" /></td>
</tr>

<tr><td><label for="description" class="required">
Description
<?php echo $this->translate('labels.description'); ?>
<span class="icon-asterisk"></span>
</label>
</td>
<td><input name="description" id="description" value="<?php echo $description; ?>" /></td>
</tr>
</table>
<button type="submit"><span class="icon-save"></span> Save</button>
<a class="btn" href="<?php echo BASE_URL; ?>/actions">
<span class="icon-remove"></span>
Cancel
</a>
<?php
$helper = $this->template->getHelper('saveAndCancelButtons');
echo $helper->saveAndCancelButtons(BASE_URI.'/actions');
?>
</fieldset>
</form>
</div>
6 changes: 4 additions & 2 deletions crm/blocks/html/bookmarks/list.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
* @author Cliff Ingham <inghamn@bloomington.in.gov>
* @param BookmarkList $this->bookmarks
*/
$title = !empty($this->title) ? View::escape($this->title) : 'Saved Searchs';
$title = !empty($this->title)
? View::escape($this->title)
: $this->translate(array('labels.bookmark', 'labels.bookmarks', 2));
if (count($this->bookmarks)) {
echo "
<div class=\"bookmarkList\">
Expand All @@ -18,7 +20,7 @@ if (count($this->bookmarks)) {
<li><a href=\"{$bookmark->getRequestUri()}\">$name</a>
<a class=\"icon-remove\"
href=\"".BASE_URI."/bookmarks/delete?bookmark_id={$bookmark->getId()};return_url=$_SERVER[REQUEST_URI]\">
<span class=\"hidden-label\">Delete</span>
<span class=\"hidden-label\">{$this->translate('labels.delete')}</span>
</a>
</li>
";
Expand Down
10 changes: 7 additions & 3 deletions crm/blocks/html/bookmarks/updateForm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ $type = View::escape($this->type);
<fieldset>
<input type="hidden" name="type" value="<?php echo $type; ?>" />
<input type="hidden" name="requestUri" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
<label>Save <?php echo $type; ?> as:<input name="name" /></label>
<button type="submit"><span class="icon-save"></span> Save</button>
<button type="reset"><span class="icon-remove"></span> Cancel</button>
<label>
<?php
echo sprintf($this->translate('labels.save_as'), $type);
?>:<input name="name" />
</label>
<button type="submit"><span class="icon-save"> </span> <?php echo $this->translate('labels.save' ); ?></button>
<button type="reset"> <span class="icon-remove"></span> <?php echo $this->translate('labels.cancel'); ?></button>
</fieldset>
</form>
4 changes: 2 additions & 2 deletions crm/blocks/html/categories/categoryChoices.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
* Each category will be a link to $return_url containg
* the category_id of the chosen category
*
* @copyright 2011-2012 City of Bloomington, Indiana
* @copyright 2011-2013 City of Bloomington, Indiana
* @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt
* @author Cliff Ingham <inghamn@bloomington.in.gov>
* @param CategoryList $this->categoryList
* @param URL $this->return_url
*/
echo "
<div class=\"categoryChoices\">
<h2>Choose a category</h2>
<h2>{$this->translate('messages.choose_category')}</h2>
<ul>
";
$return_url = $this->return_url;
Expand Down
30 changes: 16 additions & 14 deletions crm/blocks/html/categories/categoryList.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
*/
?>
<div class="categoryList">
<h2>Categories
<?php
<h2><?php
echo $this->translate(array('labels.category', 'labels.categories', 2));
if (userIsAllowed('categories','update')) {
echo '<a class="btn" href="'.BASE_URI.'/categories/update"><span class="icon-plus"></span> Add</a>';
echo sprintf('<a class="btn" href="%s"><span class="icon-plus"></span> %s</a>',
BASE_URI.'/categories/update',
$this->translate('labels.add')
);
}
?>
</h2>
Expand All @@ -36,13 +39,10 @@

$editButton = '';
if (userIsAllowed('categories','update')) {
$editButton = "
<a class=\"btn\"
href=\"".BASE_URI."/categories/update?category_id={$category->getId()}\">
<span class=\"icon-pencil\"></span>
Edit
</a>
";
$editButton = sprintf('<a class="btn" href="%s"><span class="icon-pencil"></span> %s</a>',
BASE_URI.'/categories/update?category_id='.$category->getId(),
$this->translate('labels.edit')
);
}
$name = View::escape($category->getName());
$postPermission = View::escape($category->getPostingPermissionLevel());
Expand All @@ -62,10 +62,12 @@
<p>$description</p>
<table>
<thead>
<tr><th>Department</th>
<th>SLA Days</th>
<th>Posting</th>
<th>Display</th>
<tr><th>{$this->translate(array('labels.department', 'labels.departments', 1))}</th>
<th>{$this->translate('labels.sla')}
{$this->translate(array('labels.day', 'labels.days', 2))}
</th>
<th>{$this->translate('labels.postingPermissionLevel')}</th>
<th>{$this->translate('labels.displayPermissionLevel')}</th>
</tr>
</thead>
<tbody>
Expand Down
10 changes: 5 additions & 5 deletions crm/blocks/html/categories/info.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @copyright 2012 City of Bloomington, Indiana
* @copyright 2012-2013 City of Bloomington, Indiana
* @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt
* @author Cliff Ingham <inghamn@bloomington.in.gov>
* @param Category $this->category
Expand All @@ -26,20 +26,20 @@ echo "
<tr><th>Default Department</th>
<td>$department</td>
</tr>
<tr><th>Display Permission Level</th>
<tr><th>{$this->translate('labels.displayPermissionLevel')}</th>
<td>{$this->category->getDisplayPermissionLevel()}</td>
</tr>
<tr><th>Posting Permission Level</th>
<tr><th>{$this->translate('labels.postingPermissionLevel')}</th>
<td>{$this->category->getPostingPermissionLevel()}</td>
</tr>
</table>
<form method=\"get\">
<fieldset><legend>Custom Fields</legend>
<fieldset><legend>{$this->translate('labels.custom_fields')}</legend>
";
$this->issue = new Issue();
include APPLICATION_HOME.'/blocks/html/tickets/issueCustomFields.inc';
echo "
</fieldset>
</form>
</div>
";
";
21 changes: 13 additions & 8 deletions crm/blocks/html/categories/slaForm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@
*/
?>
<div class="slaForm">
<h2>Service Level Agreement</h2>
<p>These departments agree to handle new tickets within the time specificed.</p>
<h2><?php echo $this->translate('labels.service_level_agreement'); ?></h2>
<p><?php echo $this->translate('text.service_level_agreement_description'); ?></p>

<form method="post" action="<?php echo BASE_URL; ?>/categories/sla">
<fieldset><legend>Categories</legend>
<form method="post" action="<?php echo BASE_URI; ?>/categories/sla">
<fieldset><legend><?php echo $this->translate(array('labels.category','labels.categories', 2)); ?></legend>
<table>
<thead>
<tr><th>Category</th><th>Department</th><th>SLA Days</th></tr>
<tr><th><?php echo $this->translate(array('labels.category', 'labels.categories', 1)); ?></th>
<th><?php echo $this->translate(array('labels.department', 'labels.departments', 1)); ?></th>
<th><?php echo $this->translate('labels.sla'); ?>
<?php echo $this->translate(array('labels.day', 'labels.days', 2)); ?>
</th>
</tr>
</thead>
<tbody>
<?php
Expand All @@ -41,11 +46,11 @@
</tbody>
</table>

<button type="submit"><span class="icon-save"></span> Save</button>
<button type="submit"><span class="icon-save"></span> <?php echo $this->translate('labels.save'); ?></button>
<a class="btn" href="<?php echo BASE_URI; ?>/categories">
<span class="icon-remove"></span>
Cancel
<?php echo $this->translate('labels.cancel'); ?>
</a>
</fieldset>
</form>
</div>
</div>
Loading

0 comments on commit 3fe8a95

Please sign in to comment.