diff --git a/README.md b/README.md
index 45879bb..25db511 100644
--- a/README.md
+++ b/README.md
@@ -221,16 +221,21 @@ If you wanted to have the js in-line, then you can use the `-j` or `--local-js`
There's an old saying that goes, "If you know more than one language you're multilingual, if you don't you're British." Not only is that a damning indictment of the British mentality towards other languages, but also goes to explain why the UI has only so far been in English - because I am, for all my sins, British.
-However, it is now possible to build the interface with a different language. Currently, thanks to a contributor, French is also supported. If anyone else wants to contribute additional language packs, please submit a PR!
+However, it is now possible to build the interface with a different language. Currently, thanks to contributors, French and Spanish are also supported. If anyone else wants to contribute additional language packs, please submit a PR!
If the language pack is in the `build/_languages/` directory then you can use that with the `-l` or `--lang` flag. For example, if there is a `fr.json` language pack then you can use `php ./build/build.php -l fr` in order to build with that language.
+There have been a few composer scripts added to help with the building. They are, `composer build`, `composer build-french`, and `composer build-spanish`.
+
If you want to create a language file then `build/_languages/example.json` contains all you need. It's a simple json structure with the key being the English version which matches what's in the UI, and the value is what you're converting it to - which in the example file is just blank. If a value is empty or the index doesn't exist for a translation, then it'll just use the English version. This gives you the ability to replace some or all of the interface strings as you see fit.
-So to get started with a new language, copy the `example.json` to the language you want that doesn't already exist - for example, `pt-br.json`. Then fill in the translations into the values. Once done, rebuild with `php ./build/build.php -l pt-br`.
+To get started with a new language, copy the `example.json` to the language you want that doesn't already exist - for example, `pt-br.json` or `pirate.json`. Then fill in the translations into the values. Once done, rebuild with `php ./build/build.php -l pt-br` or `php ./build/build.php -l pirate`.
## Releases
+**Version 3.5.5**\
+Added Spanish translations thanks to @cvc90 (PR#110)
+
**Version 3.5.4**\
Better handling of whether JIT is enabled or disabled. Now also shows _why_ it might be disabled even if you have the setting turned on. The interface also disables the graph and memory stats correctly for JIT if it's disabled for any reason.
diff --git a/build/_frontend/interface.jsx b/build/_frontend/interface.jsx
index 878a361..375fb99 100644
--- a/build/_frontend/interface.jsx
+++ b/build/_frontend/interface.jsx
@@ -91,7 +91,10 @@ class Interface extends React.Component {
txt={this.txt}
/>
-
+
>
);
}
@@ -1187,13 +1190,13 @@ function Footer(props) {
);
}
diff --git a/build/_languages/es.json b/build/_languages/es.json
new file mode 100644
index 0000000..e4d0aff
--- /dev/null
+++ b/build/_languages/es.json
@@ -0,0 +1,113 @@
+{
+ "(unsafe) Collect constants": "(inestable) Recoger las constantes",
+ "++, +=, series of jumps": "++, +=, series de saltos",
+ "Adjust used stack": "Ajustar pila usada",
+ "Ascending": "Ascendente",
+ "Available functions": "Funciones disponibles",
+ "blacklist misses": "fallos en la blacklist",
+ "buffer size": "tamaño del búfer",
+ "Cached": "En cache",
+ "CALL GRAPH optimization": "Optimización CALL GRAPH",
+ "CFG based optimization": "Optimización basada en CFG",
+ "Compile all functions on script load": "Compilar todas las funciones al cargar el script",
+ "Compile functions on first execution": "Compilar funciones en la primera ejecución",
+ "Constant conversion and jumps": "Conversión constante y saltos",
+ "CPU-specific optimization": "Optimización específica de la CPU",
+ "CSE, STRING construction": "Construcción CSE, STRING",
+ "Currently unused": "Actualmente sin utilizar",
+ "DCE (dead code elimination)": "DCE (eliminación del código muerto)",
+ "Descending": "Descendente",
+ "DFA based optimization": "Optimización basada en DFA",
+ "Directives": "Directivas",
+ "Disable CPU-specific optimization": "Desactivar la optimización específica de la CPU",
+ "Disable real-time update": "Desactivar la actualización en tiempo real",
+ "Do not perform register allocation": "No realizar la asignación de registros",
+ "Enable real-time update": "Activar la actualización en tiempo real",
+ "Enable use of AVX, if the CPU supports it": "Habilitar el uso de AVX, si la CPU lo soporta",
+ "false": "falso",
+ "File list pagination": "Paginación de la lista de archivos",
+ "force file invalidation": "forzar la invalidación de archivos",
+ "free memory": "memoria libre",
+ "General info": "Información general",
+ "has been invalidated": "se ha invalidado",
+ "hit rate": "índice de aciertos",
+ "hits": "hits",
+ "Host": "Host",
+ "Ignored": "Ignorado",
+ "INIT_FCALL_BY_NAME -> DO_FCALL": "INIT_FCALL_BY_NAME -> DO_FCALL",
+ "Inline functions": "Funciones inline",
+ "Inline VM handlers": "Controladores de VM en línea",
+ "interned strings usage": "utilización de cadenas internas",
+ "Invalidate all matching files": "Invalidar todos los ficheros coincidentes",
+ "jit buffer free": "búfer jit libre",
+ "jit buffer": "búfer jit",
+ "keys": "llaves",
+ "Last modified": "Última modificación",
+ "last modified": "última modificaciónn",
+ "Last reset": "Último reinicio",
+ "Last used": "Último uso",
+ "last used": "último uso",
+ "max cached keys": "llaves máximas en caché",
+ "Memory consumption": "Consumo de memoria",
+ "memory usage": "uso de memoria",
+ "memory": "memoria",
+ "Merge equal constants": "Fusionar las constantes iguales",
+ "Minimal JIT (call standard VM handlers)": "JIT mínimo (llame a controladores de VM estándar)",
+ "never": "nunca",
+ "Next": "Siguiente",
+ "No files have been cached or you have opcache.file_cache_only<\/i> turned on": "No se han almacenado archivos en caché o tiene opcache.file_cache_only<\/i> activado",
+ "No files have been ignored via opcache.blacklist_filename<\/i>": "No se han ignorado archivos a través de opcache.blacklist_filename<\/i>",
+ "No files have been preloaded opcache.preload<\/i>": "No se han precargado archivos opcache.preload<\/i>",
+ "No JIT": "No JIT",
+ "no value": "sin valor",
+ "NOP removal": "Eliminación de NOP",
+ "number of cached files": "número de archivos en caché",
+ "number of cached keys": "número de llaves en caché",
+ "Number of hits": "Número de hits",
+ "number of hits": "número de hits",
+ "number of misses": "número de misses",
+ "number of strings": "número de cadenas",
+ "opcache statistics": "estadísticas de opcache",
+ "Optimization level": "Nivel de optimización",
+ "Optimize whole script": "Optimizar todo el script",
+ "Overview": "Visión general",
+ "Path": "Ruta",
+ "Perform block-local register allocation": "Asignación de registros a nivel local de bloque",
+ "Perform global register allocation": "Realizar la asignación global de registros",
+ "preload memory": "precargar la memoria",
+ "Preloaded": "Precargado",
+ "Previous": "Anterior",
+ "Profile functions on first request and compile the hottest functions afterwards": "Perfile las funciones en la primera solicitud y luego recopile las funciones más populares",
+ "Profile on the fly and compile hot functions": "Perfilar sobre la marcha y compilar funciones en caliente",
+ "Register allocation": "Asignación de registros",
+ "Remove unused variables": "Eliminar variables no utilizadas",
+ "Reset cache": "Restablecer la caché",
+ "SCCP (constant propagation)": "SCCP (propagación de constantes)",
+ "Script": "Script",
+ "Server Software": "Software de servidor",
+ "Sort order": "Orden de clasificación",
+ "Start time": "Hora de inicio",
+ "Start typing to filter on script path": "Empiece a escribir para filtrar por ruta del script",
+ "TMP VAR usage": "Utilización de TMP VAR",
+ "total memory": "memoria total",
+ "Trigger": "Disparador",
+ "true": "verdadero",
+ "Use call graph": "Utilizar el gráfico de llamadas",
+ "Use tracing JIT. Profile on the fly and compile traces for hot code segments": "Utilice el trazado JIT. Perfila sobre la marcha y compila trazas para segmentos de código calientes.",
+ "Use type inference": "Utilizar la inferencia de tipos",
+ "used memory": "memoria utilizada",
+ "View manual page": "Ver la página del manual",
+ "View {0} manual entry": "Ver {0} entrada manual",
+ "wasted memory": "memoria perdida",
+ "You have opcache.file_cache_only<\/i> turned on. As a result, the memory information is not available. Statistics and file list may also not be returned by opcache_get_statistics()<\/i>.": "Tienes opcache.file_cache_only activado. Como resultado, la información de la memoria no está disponible. Es posible que las estadísticas y la lista de archivos tampoco sean devueltas por opcache_get_statistics()<\/i>.",
+ "{0} files cached": "{0} archivos almacenados en caché",
+ "{0} files cached, {1} showing due to filter '{2}'": "{0} archivos almacenados en caché, {1} se visualizan debido al filtro '{2}'",
+ "{0} ignore file locations": "{0} ignorar ubicaciones de archivos",
+ "{0} preloaded files": "{0} archivos precargados",
+ "JIT enabled": "JIT activado",
+ "disabled due to opcache.jit setting": "ddesactivado debido a la configuración de opcache.jit",
+ "the opcache.jit_buffer_size must be set to fully enable JIT": "el opcache.jit_buffer_size debe estar configurado para habilitar completamente JIT",
+ "incompatible with extensions that override zend_execute_ex(), such as xdebug": "incompatible con las extensiones que anulan zend_execute_ex(), como xdebug",
+ "Yes": "Sí",
+ "No": "No"
+}
diff --git a/build/_languages/example.json b/build/_languages/example.json
index ccac484..fc72bc1 100644
--- a/build/_languages/example.json
+++ b/build/_languages/example.json
@@ -21,6 +21,7 @@
"Directives": "",
"Disable CPU-specific optimization": "",
"Disable real-time update": "",
+ "disabled due to opcache.jit setting": "",
"Do not perform register allocation": "",
"Enable real-time update": "",
"Enable use of AVX, if the CPU supports it": "",
@@ -34,6 +35,7 @@
"hits": "",
"Host": "",
"Ignored": "",
+ "incompatible with extensions that override zend_execute_ex(), such as xdebug": "",
"INIT_FCALL_BY_NAME -> DO_FCALL": "",
"Inline functions": "",
"Inline VM handlers": "",
@@ -41,6 +43,7 @@
"Invalidate all matching files": "",
"jit buffer free": "",
"jit buffer": "",
+ "JIT enabled": "",
"keys": "",
"Last modified": "",
"last modified": "",
@@ -60,6 +63,7 @@
"No files have been preloaded opcache.preload<\/i>": "",
"No JIT": "",
"no value": "",
+ "No": "",
"NOP removal": "",
"number of cached files": "",
"number of cached keys": "",
@@ -86,8 +90,11 @@
"Script": "",
"Server Software": "",
"Sort order": "",
+ "Sponsor this project and author on GitHub": "",
+ "Sponsor this project": "",
"Start time": "",
"Start typing to filter on script path": "",
+ "the opcache.jit_buffer_size must be set to fully enable JIT": "",
"TMP VAR usage": "",
"total memory": "",
"Trigger": "",
@@ -96,18 +103,14 @@
"Use tracing JIT. Profile on the fly and compile traces for hot code segments": "",
"Use type inference": "",
"used memory": "",
+ "version {0}": "",
"View manual page": "",
"View {0} manual entry": "",
"wasted memory": "",
+ "Yes": "",
"You have opcache.file_cache_only<\/i> turned on. As a result, the memory information is not available. Statistics and file list may also not be returned by opcache_get_statistics()<\/i>.": "",
"{0} files cached": "",
"{0} files cached, {1} showing due to filter '{2}'": "",
"{0} ignore file locations": "",
- "{0} preloaded files": "",
- "JIT enabled": "",
- "disabled due to opcache.jit setting": "",
- "the opcache.jit_buffer_size must be set to fully enable JIT": "",
- "incompatible with extensions that override zend_execute_ex(), such as xdebug": "",
- "Yes": "",
- "No": ""
+ "{0} preloaded files": ""
}
diff --git a/build/build.php b/build/build.php
index 1b69f63..464e4ee 100644
--- a/build/build.php
+++ b/build/build.php
@@ -4,7 +4,7 @@
* OPcache GUI - build script
*
* @author Andrew Collington, andy@amnuts.com
- * @version 3.5.4
+ * @version 3.5.5
* @link https://github.com/amnuts/opcache-gui
* @license MIT, https://acollington.mit-license.org/
*/
diff --git a/build/template.phps b/build/template.phps
index fe26295..8302b09 100644
--- a/build/template.phps
+++ b/build/template.phps
@@ -6,7 +6,7 @@
* A simple but effective single-file GUI for the OPcache PHP extension.
*
* @author Andrew Collington, andy@amnuts.com
- * @version 3.5.4
+ * @version 3.5.5
* @link https://github.com/amnuts/opcache-gui
* @license MIT, https://acollington.mit-license.org/
*/
diff --git a/composer.json b/composer.json
index d408acc..b3ccb53 100644
--- a/composer.json
+++ b/composer.json
@@ -31,6 +31,8 @@
}
},
"scripts": {
- "build": "php build/build.php"
+ "build": "php build/build.php",
+ "build-french": "php build/build.php --lang fr",
+ "build-spanish": "php build/build.php --lang es"
}
}
diff --git a/index.php b/index.php
index e237275..19165b3 100644
--- a/index.php
+++ b/index.php
@@ -6,7 +6,7 @@
* A simple but effective single-file GUI for the OPcache PHP extension.
*
* @author Andrew Collington, andy@amnuts.com
- * @version 3.5.4
+ * @version 3.5.5
* @link https://github.com/amnuts/opcache-gui
* @license MIT, https://acollington.mit-license.org/
*/
@@ -59,7 +59,7 @@ header('Pragma: no-cache');
class Service
{
- public const VERSION = '3.5.4';
+ public const VERSION = '3.5.5';
protected $tz;
protected $data;
@@ -538,14 +538,13 @@ $opcache = (new Service($options))->handle();