Make embedded documentation available in multiple languages

This commit is contained in:
Frederic Guillot
2016-06-23 12:27:34 -04:00
parent 94b9235dcf
commit 75019b3a8e
65 changed files with 75 additions and 24 deletions

View File

@@ -1,3 +1,10 @@
Version 1.0.31 (unreleased)
--------------
Improvements:
* Make embedded documentation available in multiple languages
Version 1.0.30 Version 1.0.30
-------------- --------------

View File

@@ -20,16 +20,7 @@ class DocumentationController extends BaseController
$page = 'index'; $page = 'index';
} }
if ($this->languageModel->getCurrentLanguage() === 'fr_FR') { $filename = $this->getPageFilename($page);
$filename = __DIR__.'/../../doc/fr/' . $page . '.markdown';
} else {
$filename = __DIR__ . '/../../doc/' . $page . '.markdown';
}
if (!file_exists($filename)) {
$filename = __DIR__.'/../../doc/index.markdown';
}
$this->response->html($this->helper->layout->app('doc/show', $this->render($filename))); $this->response->html($this->helper->layout->app('doc/show', $this->render($filename)));
} }
@@ -83,10 +74,63 @@ class DocumentationController extends BaseController
*/ */
public function replaceImageUrl(array $matches) public function replaceImageUrl(array $matches)
{ {
if ($this->languageModel->getCurrentLanguage() === 'fr_FR') { return '('.$this->getFileBaseUrl($matches[1]).')';
return '('.$this->helper->url->base().'doc/fr/'.$matches[1].')'; }
/**
* Get Markdown file according to the current language
*
* @access private
* @param string $page
* @return string
*/
private function getPageFilename($page)
{
return $this->getFileLocation($page . '.markdown') ?:
implode(DIRECTORY_SEPARATOR, array(ROOT_DIR, 'doc', 'index.markdown'));
}
/**
* Get base URL for Markdown links
*
* @access private
* @param string $filename
* @return string
*/
private function getFileBaseUrl($filename)
{
$language = $this->languageModel->getCurrentLanguage();
$path = $this->getFileLocation($filename);
if (strpos($path, $language) !== false) {
$url = implode('/', array('doc', $language, $filename));
} else {
$url = implode('/', array('doc', $filename));
} }
return '('.$this->helper->url->base().'doc/'.$matches[1].')'; return $this->helper->url->base().$url;
}
/**
* Get file location according to the current language
*
* @access private
* @param string $filename
* @return string
*/
private function getFileLocation($filename)
{
$files = array(
implode(DIRECTORY_SEPARATOR, array(ROOT_DIR, 'doc', $this->languageModel->getCurrentLanguage(), $filename)),
implode(DIRECTORY_SEPARATOR, array(ROOT_DIR, 'doc', $filename)),
);
foreach ($files as $filename) {
if (file_exists($filename)) {
return $filename;
}
}
return '';
} }
} }

View File

@@ -6,13 +6,13 @@ Kanban vs Todo lists
### Todo lists (lista de tareas) : ### Todo lists (lista de tareas) :
Fase unica (es solo una lista de tareas) - Fase unica (es solo una lista de tareas)
Multitarea posible (no eficiente) - Multitarea posible (no eficiente)
### Kanban: ### Kanban:
Multi fases, - Multi fases,
Concentración absoluta para evitar multitareas por que se puede establecer un limite por columna para mejorar el progreso - Concentración absoluta para evitar multitareas por que se puede establecer un limite por columna para mejorar el progreso
Kanban vs Scrum Kanban vs Scrum
@@ -20,13 +20,13 @@ Kanban vs Scrum
### Scrum: ### Scrum:
Los sprints son time-boxed, usualmente 2 o 4 semanas - Los sprints son time-boxed, usualmente 2 o 4 semanas
No permitir cambios durante la iteración - No permitir cambios durante la iteración
La estimación es requerida - La estimación es requerida
Utiliza la velocidad como métrica predeterminada - Utiliza la velocidad como métrica predeterminada
El tablero de Scrum se borra entre cada sprint - El tablero de Scrum se borra entre cada sprint
Scrum tiene funciones predefinidas como scrum master , los dueños del producto y el equipo - Scrum tiene funciones predefinidas como scrum master , los dueños del producto y el equipo
Una gran cantidad de reuniones: planeaciones, backlogs grooming, daily stand-up, retrospectiva - Una gran cantidad de reuniones: planeaciones, backlogs grooming, daily stand-up, retrospectiva
### Kanban: ### Kanban:

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB