Commit bc5f9ce8 authored by Canek Peláez's avatar Canek Peláez
Browse files

Last push: i10n and localization; fixes everywhere, I consider it usable.

parent dd5272e3
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+1 −0
Original line number Diff line number Diff line
*.mo
+50 −6
Original line number Diff line number Diff line
<?php
$wc_chart_title = '';
switch ($post_type) {
case 'post':
    $wc_chart_title = ($dt_unit == 'year') ?
        __("Words in posts by year", 'word-count') :
    __("Words in posts by month", 'word-count');
    break;
case 'page':
    $wc_chart_title = ($dt_unit == 'year') ?
        __("Words in pages by year", 'word-count') :
    __("Words in pages by month", 'word-count');
    break;
}
?>
<div class="wc-stats-chart">
  <p>
    <strong>Words in <?php echo $post_type; ?>s by <?php echo $dt_unit; ?></strong>
     <strong><?php echo $wc_chart_title; ?></strong>
  </p>
  <div class="wc-chart" id="wc-<?php echo $post_type; ?>-<?php echo $dt_unit; ?>-count" ></div>
  <script type="text/javascript">
      var options = {
          chart: { type: 'line' },
          series: [
              {
                  name: 'Word count',
          chart: {
              type: 'line',
              locales: [{
<?php _e("                  name: 'en',
                  options: {
                      months: [ 'January', 'February', 'March', 'April',
                                'May', 'June', 'July', 'August',
                                'September', 'October', 'November', 'December' ],
                      shortMonths: [ 'Jan', 'Feb', 'Mar', 'Apr',
                                     'May', 'Jun', 'Jul', 'Aug',
                                     'Sep', 'Oct', 'Nov', 'Dec' ],
                      days: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday',
                              'Thursday', 'Friday', 'Saturday' ],
                      shortDays: ['Sun', 'Mon', 'Tue', 'Wed',
                                  'Thu', 'Fri', 'Sat'],
                      toolbar: {
                          menu: 'Menu',
                          exportToSVG: 'Download SVG',
                          exportToPNG: 'Download PNG',
                          exportToCSV: 'Download CSV',
                          selection: 'Selection',
                          selectionZoom: 'Selection Zoom',
                          zoomIn: 'Zoom In',
                          zoomOut: 'Zoom Out',
                          pan: 'Panning',
                          reset: 'Reset Zoom',
                      }
                  }", 'word-count'); ?>,
              }],
              defaultLocale: '<?php echo (substr(get_locale(), 0, 2)); ?>'
          },
          series: [{
              name: '<?php _e("Word count", "word-count"); ?>',
              data: [ <?php
$i = 0;
foreach (array_keys($unit_count) as $unit) {

languages/README.md

0 → 100644
+22 −0
Original line number Diff line number Diff line
1. Generate POT file:
   ```sh
   xgettext -L PHP -d word-count -s -j *.php  --from-code=UTF-8 -k_e -k__ -o languages/word-count.pot
   ```

2. Copy POT file to `.po` file:

    ```sh
    cp languages/word-count.pot languages/ll_LL.po
    ```

3. Generate `.mo` file:

    ```sh
    msgfmt languages/ll_LL.po -o languages/ll_LL.mo
    ```

4. Update `.po` file:

    ```sh
    msgmerge -U languages/es_MX.po languages/word-count.pot
    ```

languages/es_MX.po

0 → 100644
+217 −0
Original line number Diff line number Diff line
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: word-count 0.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-18 22:09-0500\n"
"PO-Revision-Date: 2021-10-18 22:10-0500\n"
"Last-Translator: Canek Peláez <canek@ciencias.unam.mx>\n"
"Language-Team: Spanish\n"
"Language: Spanish\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: datetime-chart.php:26
msgid ""
"                  name: 'en',\n"
"                  options: {\n"
"                      months: [ 'January', 'February', 'March', 'April',\n"
"                                'May', 'June', 'July', 'August',\n"
"                                'September', 'October', 'November', "
"'December' ],\n"
"                      shortMonths: [ 'Jan', 'Feb', 'Mar', 'Apr',\n"
"                                     'May', 'Jun', 'Jul', 'Aug',\n"
"                                     'Sep', 'Oct', 'Nov', 'Dec' ],\n"
"                      days: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n"
"                              'Thursday', 'Friday', 'Saturday' ],\n"
"                      shortDays: ['Sun', 'Mon', 'Tue', 'Wed',\n"
"                                  'Thu', 'Fri', 'Sat'],\n"
"                      toolbar: {\n"
"                          menu: 'Menu',\n"
"                          exportToSVG: 'Download SVG',\n"
"                          exportToPNG: 'Download PNG',\n"
"                          exportToCSV: 'Download CSV',\n"
"                          selection: 'Selection',\n"
"                          selectionZoom: 'Selection Zoom',\n"
"                          zoomIn: 'Zoom In',\n"
"                          zoomOut: 'Zoom Out',\n"
"                          pan: 'Panning',\n"
"                          reset: 'Reset Zoom',\n"
"                      }\n"
"                  }"
msgstr ""
"                  name: 'es',\n"
"                  options: {\n"
"                      months: [ 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre' ],\n"
"                      shortMonths: [ 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic' ],\n"
"                      days: [ 'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado' ],\n"
"                      shortDays: [ 'Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb' ],\n"
"                      toolbar: {\n"
"                          menu: 'Menú',\n"
"                          exportToSVG: 'Descargar SVG',\n"
"                          exportToPNG: 'Descargar PNG',\n"
"                          exportToCSV: 'Descargar CSV',\n"
"                          selection: 'Selección',\n"
"                          selectionZoom: 'Detalle selección',\n"
"                          zoomIn: 'Acercarse',\n"
"                          zoomOut: 'Alejarse',\n"
"                          pan: 'Panorámica',\n"
"                          reset: 'Restaurar vista',\n"
"                      }\n"
"                  }"

#: datetime-chart.php:27
msgid ""
"                  name: 'en',\n"
"                  options: {\n"
"                      months: [ 'January', 'February', 'March', 'April',\n"
"                                'May', 'June', 'July', 'August',\n"
"                                'September', 'October', 'November', "
"'December' ],\n"
"                      shortMonths: [ 'Jan', 'Feb', 'Mar', 'Apr',\n"
"                                     'May', 'Jun', 'Jul', 'Aug',\n"
"                                     'Sep', 'Oct', 'Nov', 'Dec' ],\n"
"                      days: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n"
"                              'Thursday', 'Friday', 'Saturday' ],\n"
"                      shortDays: ['Sun', 'Mon', 'Tue', 'Wed',\n"
"                                  'Thu', 'Fri', 'Sat'],\n"
"                      toolbar: {\n"
"                          exportToSVG: 'Download SVG',\n"
"                          selection: 'Selection',\n"
"                          selectionZoom: 'Selection Zoom',\n"
"                          zoomIn: 'Zoom In',\n"
"                          zoomOut: 'Zoom Out',\n"
"                          pan: 'Panning',\n"
"                          reset: 'Reset Zoom',\n"
"                      }\n"
"                  }\n"
"              }]"
msgstr ""
"    name: 'es',\n"
"    options: {\n"
"        months: [ 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', "
"'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre' ],\n"
"        shortMonths: [ 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', "
"'Ago', 'Sep', 'Oct', 'Nov', 'Dic' ],\n"
"        days: [ 'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', "
"'Viernes', 'Sábado' ],\n"
"        shortDays: [ 'Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb' ],\n"
"        toolbar: {\n"
"            exportToSVG: 'Descargar SVG',\n"
"            selection: 'Selección',\n"
"            selectionZoom: 'Detalle selección',\n"
"            zoomIn: 'Acercarse',\n"
"            zoomOut: 'Alejarse',\n"
"            pan: 'Panorámica',\n"
"            reset: 'Restaurar vista',\n"
"        }\n"
"    }"

#: tab-barcharts.php:18 tab-piecharts.php:18 tab-stats.php:20 tab-tables.php:18
#: tab-stats.php:25
msgid "Bar charts"
msgstr "G. de barras"

#: tab-barcharts.php:35 tab-piecharts.php:35 tab-stats.php:40 tab-tables.php:35
#: tab-stats.php:45
msgid "Count again"
msgstr "Contar de nuevo"

#: top-20-barcharts.php:194 top-20-piecharts.php:157 top-20-tables.php:156
msgid "Filter"
msgstr "Filtrar"

#: top-20-tables.php:80
msgid "No."
msgstr "Núm."

#: top-20-tables.php:105
msgid "Page: "
msgstr "Página: "

#: tab-stats.php:32 tab-stats.php:37
msgid "Pages statistics"
msgstr "Estadísticas de páginas"

#: tab-barcharts.php:21 tab-piecharts.php:21 tab-stats.php:23 tab-tables.php:21
#: tab-stats.php:28
msgid "Pie charts"
msgstr "G. de pastel"

#: tab-stats.php:29 tab-stats.php:34
msgid "Posts statistics"
msgstr "Estadísticas de entradas"

#: tab-barcharts.php:12 tab-piecharts.php:12 tab-stats.php:14 tab-tables.php:12
#: tab-stats.php:19
msgid "Statistics"
msgstr "Estadísticas"

#: tab-barcharts.php:15 tab-piecharts.php:15 tab-stats.php:17 tab-tables.php:15
#: tab-stats.php:22
msgid "Tables"
msgstr "Cuadros"

#: top-20-tables.php:82
msgid "Title"
msgstr "Título"

#: tab-barcharts.php:30 tab-piecharts.php:30 tab-tables.php:29
msgid "Top 20 pages"
msgstr "20 páginas con más palabras"

#: tab-barcharts.php:27 tab-piecharts.php:27 tab-tables.php:27
msgid "Top 20 posts"
msgstr "20 entradas con más palabras"

#: stats.php:51
msgid "Total page words:"
msgstr "Palabras en páginas:"

#: stats.php:51
msgid "Total post words:"
msgstr "Palabras en entradas:"

#: tab-stats.php:36 tab-stats.php:41
msgid "Total words:"
msgstr "Total de palabras:"

#: datetime-chart.php:26 top-20-tables.php:81 word-count.php:21
#: datetime-chart.php:53 datetime-chart.php:52
msgid "Word count"
msgstr "Número de palabras"

#: word-count.php:21 tab-barcharts.php:8 tab-piecharts.php:8 tab-stats.php:10
#: tab-tables.php:8 word-count.php:20 tab-stats.php:15
msgid "Word count and statistics for posts and pages"
msgstr "Número de palabras y estadísticas para entradas y páginas"

#: page.php:110
msgid "Word counting in progress:"
msgstr "Contando palabras:"

#: top-20-barcharts.php:79
msgid "Words"
msgstr "Palabras"

#: datetime-chart.php:12
msgid "Words in pages by month"
msgstr "Palabras en páginas por mes"

#: datetime-chart.php:11
msgid "Words in pages by year"
msgstr "Palabras en páginas por año"

#: datetime-chart.php:7
msgid "Words in posts by month"
msgstr "Palabras en entradas por mes"

#: datetime-chart.php:6
msgid "Words in posts by year"
msgstr "Palabras en entradas por año"
+179 −0
Original line number Diff line number Diff line
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-18 22:09-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: datetime-chart.php:26
msgid ""
"                  name: 'en',\n"
"                  options: {\n"
"                      months: [ 'January', 'February', 'March', 'April',\n"
"                                'May', 'June', 'July', 'August',\n"
"                                'September', 'October', 'November', "
"'December' ],\n"
"                      shortMonths: [ 'Jan', 'Feb', 'Mar', 'Apr',\n"
"                                     'May', 'Jun', 'Jul', 'Aug',\n"
"                                     'Sep', 'Oct', 'Nov', 'Dec' ],\n"
"                      days: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n"
"                              'Thursday', 'Friday', 'Saturday' ],\n"
"                      shortDays: ['Sun', 'Mon', 'Tue', 'Wed',\n"
"                                  'Thu', 'Fri', 'Sat'],\n"
"                      toolbar: {\n"
"                          menu: 'Menu',\n"
"                          exportToSVG: 'Download SVG',\n"
"                          exportToPNG: 'Download PNG',\n"
"                          exportToCSV: 'Download CSV',\n"
"                          selection: 'Selection',\n"
"                          selectionZoom: 'Selection Zoom',\n"
"                          zoomIn: 'Zoom In',\n"
"                          zoomOut: 'Zoom Out',\n"
"                          pan: 'Panning',\n"
"                          reset: 'Reset Zoom',\n"
"                      }\n"
"                  }"
msgstr ""

#: datetime-chart.php:27
msgid ""
"                  name: 'en',\n"
"                  options: {\n"
"                      months: [ 'January', 'February', 'March', 'April',\n"
"                                'May', 'June', 'July', 'August',\n"
"                                'September', 'October', 'November', "
"'December' ],\n"
"                      shortMonths: [ 'Jan', 'Feb', 'Mar', 'Apr',\n"
"                                     'May', 'Jun', 'Jul', 'Aug',\n"
"                                     'Sep', 'Oct', 'Nov', 'Dec' ],\n"
"                      days: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n"
"                              'Thursday', 'Friday', 'Saturday' ],\n"
"                      shortDays: ['Sun', 'Mon', 'Tue', 'Wed',\n"
"                                  'Thu', 'Fri', 'Sat'],\n"
"                      toolbar: {\n"
"                          exportToSVG: 'Download SVG',\n"
"                          selection: 'Selection',\n"
"                          selectionZoom: 'Selection Zoom',\n"
"                          zoomIn: 'Zoom In',\n"
"                          zoomOut: 'Zoom Out',\n"
"                          pan: 'Panning',\n"
"                          reset: 'Reset Zoom',\n"
"                      }\n"
"                  }\n"
"              }]"
msgstr ""

#: tab-barcharts.php:18 tab-piecharts.php:18 tab-stats.php:20 tab-tables.php:18
#: tab-stats.php:25
msgid "Bar charts"
msgstr ""

#: tab-barcharts.php:35 tab-piecharts.php:35 tab-stats.php:40 tab-tables.php:35
#: tab-stats.php:45
msgid "Count again"
msgstr ""

#: top-20-barcharts.php:194 top-20-piecharts.php:157 top-20-tables.php:156
msgid "Filter"
msgstr ""

#: top-20-tables.php:80
msgid "No."
msgstr ""

#: top-20-tables.php:105
msgid "Page: "
msgstr ""

#: tab-stats.php:32 tab-stats.php:37
msgid "Pages statistics"
msgstr ""

#: tab-barcharts.php:21 tab-piecharts.php:21 tab-stats.php:23 tab-tables.php:21
#: tab-stats.php:28
msgid "Pie charts"
msgstr ""

#: tab-stats.php:29 tab-stats.php:34
msgid "Posts statistics"
msgstr ""

#: tab-barcharts.php:12 tab-piecharts.php:12 tab-stats.php:14 tab-tables.php:12
#: tab-stats.php:19
msgid "Statistics"
msgstr ""

#: tab-barcharts.php:15 tab-piecharts.php:15 tab-stats.php:17 tab-tables.php:15
#: tab-stats.php:22
msgid "Tables"
msgstr ""

#: top-20-tables.php:82
msgid "Title"
msgstr ""

#: tab-barcharts.php:30 tab-piecharts.php:30 tab-tables.php:29
msgid "Top 20 pages"
msgstr ""

#: tab-barcharts.php:27 tab-piecharts.php:27 tab-tables.php:27
msgid "Top 20 posts"
msgstr ""

#: stats.php:51
msgid "Total page words:"
msgstr ""

#: stats.php:51
msgid "Total post words:"
msgstr ""

#: tab-stats.php:36 tab-stats.php:41
msgid "Total words:"
msgstr ""

#: datetime-chart.php:26 top-20-tables.php:81 word-count.php:21
#: datetime-chart.php:53 datetime-chart.php:52
msgid "Word count"
msgstr ""

#: word-count.php:21 tab-barcharts.php:8 tab-piecharts.php:8 tab-stats.php:10
#: tab-tables.php:8 word-count.php:20 tab-stats.php:15
msgid "Word count and statistics for posts and pages"
msgstr ""

#: page.php:110
msgid "Word counting in progress:"
msgstr ""

#: top-20-barcharts.php:79
msgid "Words"
msgstr ""

#: datetime-chart.php:12
msgid "Words in pages by month"
msgstr ""

#: datetime-chart.php:11
msgid "Words in pages by year"
msgstr ""

#: datetime-chart.php:7
msgid "Words in posts by month"
msgstr ""

#: datetime-chart.php:6
msgid "Words in posts by year"
msgstr ""
Loading