Skip to content

Commit

Permalink
Updating to new language module:key syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamfairholm committed Jan 9, 2012
1 parent ebb200e commit 50177ec
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions details.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public function info()
'menu' => 'content', // You can also place modules in their top level menu. For example try: 'menu' => 'Sample',
'sections' => array(
'items' => array(
'name' => 'sample.items', // These are translated from your language file
'name' => 'sample:items', // These are translated from your language file
'uri' => 'admin/sample',
'shortcuts' => array(
'create' => array(
'name' => 'sample.create',
'name' => 'sample:create',
'uri' => 'admin/sample/create',
'class' => 'add'
)
Expand Down
26 changes: 13 additions & 13 deletions language/english/sample_lang.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?php
//messages
$lang['sample.success'] = 'It worked';
$lang['sample.error'] = 'It didn\'t work';
$lang['sample.no_items'] = 'No Items';
$lang['sample:success'] = 'It worked';
$lang['sample:error'] = 'It didn\'t work';
$lang['sample:no_items'] = 'No Items';

//page titles
$lang['sample.create'] = 'Create Item';
$lang['sample:create'] = 'Create Item';

//labels
$lang['sample.name'] = 'Name';
$lang['sample.slug'] = 'Slug';
$lang['sample.manage'] = 'Manage';
$lang['sample.item_list'] = 'Item List';
$lang['sample.view'] = 'View';
$lang['sample.edit'] = 'Edit';
$lang['sample.delete'] = 'Delete';
$lang['sample:name'] = 'Name';
$lang['sample:slug'] = 'Slug';
$lang['sample:manage'] = 'Manage';
$lang['sample:item_list'] = 'Item List';
$lang['sample:view'] = 'View';
$lang['sample:edit'] = 'Edit';
$lang['sample:delete'] = 'Delete';

//buttons
$lang['sample.custom_button'] = 'Custom Button';
$lang['sample.items'] = 'Items';
$lang['sample:custom_button'] = 'Custom Button';
$lang['sample:items'] = 'Items';
?>
6 changes: 3 additions & 3 deletions views/admin/form.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section class="title">
<!-- We'll use $this->method to switch between sample.create & sample.edit -->
<h4><?php echo lang('sample.'.$this->method); ?></h4>
<h4><?php echo lang('sample:'.$this->method); ?></h4>
</section>

<section class="item">
Expand All @@ -11,12 +11,12 @@

<ul>
<li class="<?php echo alternator('', 'even'); ?>">
<label for="name"><?php echo lang('sample.name'); ?> <span>*</span></label>
<label for="name"><?php echo lang('sample:name'); ?> <span>*</span></label>
<div class="input"><?php echo form_input('name', set_value('name', $name), 'class="width-15"'); ?></div>
</li>

<li class="<?php echo alternator('', 'even'); ?>">
<label for="slug"><?php echo lang('sample.slug'); ?> <span>*</span></label>
<label for="slug"><?php echo lang('sample:slug'); ?> <span>*</span></label>
<div class="input"><?php echo form_input('slug', set_value('slug', $slug), 'class="width-15"'); ?></div>
</li>
</ul>
Expand Down
14 changes: 7 additions & 7 deletions views/admin/items.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<section class="title">
<h4><?php echo lang('sample.item_list'); ?></h4>
<h4><?php echo lang('sample:item_list'); ?></h4>
</section>

<section class="item">
Expand All @@ -11,8 +11,8 @@
<thead>
<tr>
<th><?php echo form_checkbox(array('name' => 'action_to_all', 'class' => 'check-all'));?></th>
<th><?php echo lang('sample.name'); ?></th>
<th><?php echo lang('sample.slug'); ?></th>
<th><?php echo lang('sample:name'); ?></th>
<th><?php echo lang('sample:slug'); ?></th>
<th></th>
</tr>
</thead>
Expand All @@ -32,9 +32,9 @@
<?php echo rtrim(site_url(), '/').'/sample'; ?></a></td>
<td class="actions">
<?php echo
anchor('sample', lang('sample.view'), 'class="button" target="_blank"').' '.
anchor('admin/sample/edit/'.$item->id, lang('sample.edit'), 'class="button"').' '.
anchor('admin/sample/delete/'.$item->id, lang('sample.delete'), array('class'=>'button')); ?>
anchor('sample', lang('sample:view'), 'class="button" target="_blank"').' '.
anchor('admin/sample/edit/'.$item->id, lang('sample:edit'), 'class="button"').' '.
anchor('admin/sample/delete/'.$item->id, lang('sample:delete'), array('class'=>'button')); ?>
</td>
</tr>
<?php endforeach; ?>
Expand All @@ -46,7 +46,7 @@
</div>

<?php else: ?>
<div class="no_data"><?php echo lang('sample.no_items'); ?></div>
<div class="no_data"><?php echo lang('sample:no_items'); ?></div>
<?php endif;?>

<?php echo form_close(); ?>
Expand Down
4 changes: 2 additions & 2 deletions views/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<div class="sample-data">
<table cellpadding="0" cellspacing="0">
<tr>
<th>{{ helper:lang line="sample.name" }}</th>
<th>{{ helper:lang line="sample.slug" }}</th>
<th>{{ helper:lang line="sample:name" }}</th>
<th>{{ helper:lang line="sample:slug" }}</th>
</tr>
<!-- Here we loop through the $items array -->
{{ items }}
Expand Down

0 comments on commit 50177ec

Please sign in to comment.