Translate remaining Go source and overlay.html comments to English
Identifiers, comments, and log/console messages in auth.go, i18n.go, counter.go, totals.go, and overlay.html's script/CSS comments — the files the TLS commit didn't already touch. No functional changes. locales/*.json and overlay.html's own FALLBACK/data-i18n strings stay bilingual on purpose: that's end-user text for the overlay/panel, a different audience than the source code, served by the existing i18n system rather than this convention.
This commit is contained in:
1 parent
e9fe10f0f7
commit
5a2c3272e9
7 files changed
+213
-211
No files matched your search
+30
-29
@@ -6,8 +6,8 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// cada test corre en su propio directorio: totals.json y offset.txt
|
||||
// se resuelven contra el ejecutable, asi que lo apuntamos al temporal.
|
||||
// each test runs in its own directory: totals.json and offset.txt resolve
|
||||
// relative to the executable, so we point that at the temp dir.
|
||||
func fresh(t *testing.T, legacy string) {
|
||||
t.Helper()
|
||||
dir := t.TempDir()
|
||||
@@ -24,90 +24,91 @@ func fresh(t *testing.T, legacy string) {
|
||||
|
||||
func total(t *testing.T) int64 { t.Helper(); return st.snapshot().Total }
|
||||
|
||||
// EL CASO DE EMMA: cambiar de personaje tiene que mover el numero YA,
|
||||
// sin esperar a que alguien se muera.
|
||||
func TestCambioDePersonajeActualizaAlInstante(t *testing.T) {
|
||||
// THE EMMA CASE: switching characters has to move the number RIGHT AWAY,
|
||||
// without waiting for anyone to die.
|
||||
func TestCharacterSwitchUpdatesInstantly(t *testing.T) {
|
||||
fresh(t, "")
|
||||
|
||||
st.setCharacter(0, "emma", 40)
|
||||
st.setReading(40, false)
|
||||
if got := total(t); got != 40 {
|
||||
t.Fatalf("emma deberia arrancar con sus 40 muertes, dio %d", got)
|
||||
t.Fatalf("emma should start at her 40 deaths, got %d", got)
|
||||
}
|
||||
|
||||
// se va al menu y carga otro personaje, con otro conteo propio
|
||||
// goes to the menu and loads another character, with its own count
|
||||
st.setPlayerUnloaded("menu")
|
||||
st.setCharacter(1, "emmatherock", 7)
|
||||
if got := total(t); got != 7 {
|
||||
t.Fatalf("al cargar emmatherock el total tenia que saltar a 7 SIN morir, dio %d", got)
|
||||
t.Fatalf("loading emmatherock should jump the total to 7 WITHOUT dying, got %d", got)
|
||||
}
|
||||
st.setReading(7, false)
|
||||
if got := total(t); got != 7 {
|
||||
t.Fatalf("tras la lectura deberia seguir en 7, dio %d", got)
|
||||
t.Fatalf("after the reading it should still be 7, got %d", got)
|
||||
}
|
||||
|
||||
// y volver muestra lo que el juego lleva para emma
|
||||
// and switching back shows what the game tracks for emma
|
||||
st.setPlayerUnloaded("menu")
|
||||
st.setCharacter(0, "emma", 41)
|
||||
st.setReading(41, false)
|
||||
if got := total(t); got != 41 {
|
||||
t.Fatalf("volviendo a emma deberia dar 41, dio %d", got)
|
||||
t.Fatalf("switching back to emma should give 41, got %d", got)
|
||||
}
|
||||
}
|
||||
|
||||
// Dos personajes con el MISMO nombre no se tienen que mezclar.
|
||||
func TestHomonimosNoSeMezclan(t *testing.T) {
|
||||
// Two characters with the SAME name must not get mixed up.
|
||||
func TestHomonymsDontMix(t *testing.T) {
|
||||
fresh(t, "")
|
||||
st.setCharacter(0, "Tarnished", 100)
|
||||
st.setReading(100, false)
|
||||
st.setCharacter(3, "Tarnished", 5)
|
||||
st.setReading(5, false)
|
||||
if got := total(t); got != 5 {
|
||||
t.Fatalf("el del slot 3 deberia dar 5, dio %d", got)
|
||||
t.Fatalf("slot 3's should give 5, got %d", got)
|
||||
}
|
||||
if c, ok := totals.get("slot0"); !ok || c.Total != 100 {
|
||||
t.Fatalf("el del slot 0 deberia seguir en 100, dio %+v", c)
|
||||
t.Fatalf("slot 0's should still be 100, got %+v", c)
|
||||
}
|
||||
}
|
||||
|
||||
// El total es el del juego, sin importar que haya un offset.txt viejo
|
||||
// dando vueltas al lado del programa.
|
||||
func TestIgnoraElOffsetViejo(t *testing.T) {
|
||||
// The total is the game's, no matter if a stale offset.txt is lying
|
||||
// around next to the program.
|
||||
func TestIgnoresStaleOffset(t *testing.T) {
|
||||
fresh(t, "124")
|
||||
st.setCharacter(0, "emma", 30)
|
||||
st.setReading(30, false)
|
||||
if got := total(t); got != 30 {
|
||||
t.Fatalf("deberia mostrar las 30 del juego y no las 124 del archivo viejo, dio %d", got)
|
||||
t.Fatalf("should show the game's 30, not the old file's 124, got %d", got)
|
||||
}
|
||||
}
|
||||
|
||||
// Sin poder leer el slot, cae al nombre y sigue funcionando.
|
||||
func TestSinSlotCaeAlNombre(t *testing.T) {
|
||||
// Without being able to read the slot, it falls back to the name and
|
||||
// keeps working.
|
||||
func TestNoSlotFallsBackToName(t *testing.T) {
|
||||
fresh(t, "")
|
||||
st.setCharacter(-1, "emma", 40)
|
||||
st.setReading(40, false)
|
||||
if got := total(t); got != 40 {
|
||||
t.Fatalf("deberia dar 40, dio %d", got)
|
||||
t.Fatalf("should give 40, got %d", got)
|
||||
}
|
||||
if _, ok := totals.get("name:emma"); !ok {
|
||||
t.Fatal("deberia haberlo guardado por nombre")
|
||||
t.Fatal("should have saved it by name")
|
||||
}
|
||||
}
|
||||
|
||||
// Al reabrir el programa con el juego cerrado, muestra el ultimo
|
||||
// personaje conocido en vez de un cero.
|
||||
func TestRecuerdaElUltimoAlReabrir(t *testing.T) {
|
||||
// Reopening the program with the game closed shows the last known
|
||||
// character instead of a zero.
|
||||
func TestRemembersTheLastOneOnReopen(t *testing.T) {
|
||||
fresh(t, "")
|
||||
st.setCharacter(2, "emma", 88)
|
||||
st.setReading(88, false)
|
||||
|
||||
totals = newTotalsStore() // simula reabrir el programa
|
||||
totals = newTotalsStore() // simulates reopening the program
|
||||
st = state{}
|
||||
st.init(totals)
|
||||
if got := total(t); got != 88 {
|
||||
t.Fatalf("al reabrir deberia mostrar 88, dio %d", got)
|
||||
t.Fatalf("reopening should show 88, got %d", got)
|
||||
}
|
||||
if st.snapshot().CharName != "emma" {
|
||||
t.Fatalf("y recordar el nombre, dio %q", st.snapshot().CharName)
|
||||
t.Fatalf("and remember the name, got %q", st.snapshot().CharName)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user