Skip to content

Commit

Permalink
Next release (#112)
Browse files Browse the repository at this point in the history
* Creation of the translation archive for the Spanish language in Spain
* Fixed incorrect footer version handling and made into language pack values
* Added package-lock to repo
* Added a couple composer scripts and updated readme

---------

Co-authored-by: Carlos V <[email protected]>
  • Loading branch information
amnuts and cvc90 authored Jun 23, 2024
1 parent f3a8fe4 commit 4ad9866
Show file tree
Hide file tree
Showing 11 changed files with 3,517 additions and 156 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
13 changes: 8 additions & 5 deletions build/_frontend/interface.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ class Interface extends React.Component {
txt={this.txt}
/>
</header>
<Footer version={this.props.opstate.version.gui} />
<Footer
version={this.props.opstate.version.gui}
txt={this.txt}
/>
</>
);
}
Expand Down Expand Up @@ -1187,13 +1190,13 @@ function Footer(props) {
<footer className="main-footer">
<a className="github-link" href="https://github.com/amnuts/opcache-gui"
target="_blank"
title="opcache-gui (currently version {props.version}) on GitHub"
>https://github.com/amnuts/opcache-gui - version {props.version}</a>
title={props.txt("opcache-gui (currently version {0}) on GitHub", props.version)}
>https://github.com/amnuts/opcache-gui - {props.txt("version {0}", props.version)}</a>

<a className="sponsor-link" href="https://github.com/sponsors/amnuts"
target="_blank"
title="Sponsor this project and author on GitHub"
>Sponsor this project</a>
title={props.txt("Sponsor this project and author on GitHub")}
>{props.txt("Sponsor this project")}</a>
</footer>
);
}
Expand Down
113 changes: 113 additions & 0 deletions build/_languages/es.json
Original file line number Diff line number Diff line change
@@ -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 <i>opcache.file_cache_only<\/i> turned on": "No se han almacenado archivos en caché o tiene <i>opcache.file_cache_only<\/i> activado",
"No files have been ignored via <i>opcache.blacklist_filename<\/i>": "No se han ignorado archivos a través de <i>opcache.blacklist_filename<\/i>",
"No files have been preloaded <i>opcache.preload<\/i>": "No se han precargado archivos <i>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 <i>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 <i>opcache_get_statistics()<\/i>.": "Tienes <i>opcache.file_cache_only</i> 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 <i>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 <i>opcache.jit</i> setting": "ddesactivado debido a la configuración de <i>opcache.jit</i>",
"the <i>opcache.jit_buffer_size</i> must be set to fully enable JIT": "el <i>opcache.jit_buffer_size</i> debe estar configurado para habilitar completamente JIT",
"incompatible with extensions that override <i>zend_execute_ex()</i>, such as <i>xdebug</i>": "incompatible con las extensiones que anulan <i>zend_execute_ex()</i>, como <i>xdebug</i>",
"Yes": "",
"No": "No"
}
17 changes: 10 additions & 7 deletions build/_languages/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"Directives": "",
"Disable CPU-specific optimization": "",
"Disable real-time update": "",
"disabled due to <i>opcache.jit</i> setting": "",
"Do not perform register allocation": "",
"Enable real-time update": "",
"Enable use of AVX, if the CPU supports it": "",
Expand All @@ -34,13 +35,15 @@
"hits": "",
"Host": "",
"Ignored": "",
"incompatible with extensions that override <i>zend_execute_ex()</i>, such as <i>xdebug</i>": "",
"INIT_FCALL_BY_NAME -> DO_FCALL": "",
"Inline functions": "",
"Inline VM handlers": "",
"interned strings usage": "",
"Invalidate all matching files": "",
"jit buffer free": "",
"jit buffer": "",
"JIT enabled": "",
"keys": "",
"Last modified": "",
"last modified": "",
Expand All @@ -60,6 +63,7 @@
"No files have been preloaded <i>opcache.preload<\/i>": "",
"No JIT": "",
"no value": "",
"No": "",
"NOP removal": "",
"number of cached files": "",
"number of cached keys": "",
Expand All @@ -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 <i>opcache.jit_buffer_size</i> must be set to fully enable JIT": "",
"TMP VAR usage": "",
"total memory": "",
"Trigger": "",
Expand All @@ -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 <i>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 <i>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 <i>opcache.jit</i> setting": "",
"the <i>opcache.jit_buffer_size</i> must be set to fully enable JIT": "",
"incompatible with extensions that override <i>zend_execute_ex()</i>, such as <i>xdebug</i>": "",
"Yes": "",
"No": ""
"{0} preloaded files": ""
}
2 changes: 1 addition & 1 deletion build/build.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* OPcache GUI - build script
*
* @author Andrew Collington, [email protected]
* @version 3.5.4
* @version 3.5.5
* @link https://github.com/amnuts/opcache-gui
* @license MIT, https://acollington.mit-license.org/
*/
Expand Down
2 changes: 1 addition & 1 deletion build/template.phps
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* A simple but effective single-file GUI for the OPcache PHP extension.
*
* @author Andrew Collington, [email protected]
* @version 3.5.4
* @version 3.5.5
* @link https://github.com/amnuts/opcache-gui
* @license MIT, https://acollington.mit-license.org/
*/
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Loading

0 comments on commit 4ad9866

Please sign in to comment.