Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: HaikuArchives/Moe
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5eba43de1ed0
Choose a base ref
...
head repository: HaikuArchives/Moe
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 652ce7a28f88
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Oct 25, 2021

  1. Improved translatability

    Hard-coding "1s" for "1 second" for ll languages isn't ideal.
    Use BStringFormat instead.
    Updated catkeys.
    Humdinger committed Oct 25, 2021
    Copy the full SHA
    652ce7a View commit details
Showing with 11 additions and 5 deletions.
  1. +7 −3 source/MoeMascotMenu.cpp
  2. +2 −1 source/locales/en.catkeys
  3. +2 −1 source/locales/es.catkeys
10 changes: 7 additions & 3 deletions source/MoeMascotMenu.cpp
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@
#include <Application.h>
#include <MenuItem.h>
#include <Message.h>
#include <StringFormat.h>
#include <Catalog.h>
#include "MoeDefs.h"
#include "MoeProperty.h"
@@ -213,12 +214,15 @@ MoeMascotMenu::InitItems(MoeMascot *target, bool advanced)
menu = new BMenu(B_TRANSLATE("Wink"));
for (i = 0; i < 5; i++)
{
BString buf;
buf << i + 1 << "s";
BString text;
static BStringFormat format(B_TRANSLATE("{0, plural,"
"one{# second}"
"other{# seconds}}"));
format.Format(text, i + 1);
interval = (i + 1) * 1000000;
msg = new BMessage(MOE_SET_WINK_INTERVAL);
msg->AddInt64("data", interval);
item = new BMenuItem(buf.String(), msg);
item = new BMenuItem(text.String(), msg);
item->SetMarked(property->GetWinkInterval() == interval);
item->SetTarget(property);
menu->AddItem(item);
3 changes: 2 additions & 1 deletion source/locales/en.catkeys
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1 English application/x-vnd.Kamnagi.Moe 2411587421
1 English application/x-vnd.Kamnagi.Moe 85406669
Redraw MascotMenu Redraw
Side MascotMenu Side
Cancel Property Cancel
@@ -40,6 +40,7 @@ Lock MascotMenu Text when Y is locked. Lock
This window of this application MascotMenu This window of this application
Fast MascotMenu Fast
Cancel Mascot Cancel
{0, plural,one{# second}other{# seconds}} MascotMenu {0, plural,one{# second}other{# seconds}}
left MascotMenu left
Fastest MascotMenu Fastest
Debug frame visible MascotMenu Debug frame visible
3 changes: 2 additions & 1 deletion source/locales/es.catkeys
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1 English application/x-vnd.Kamnagi.Moe 2411587421
1 English application/x-vnd.Kamnagi.Moe 85406669
Redraw MascotMenu Redibujado
Side MascotMenu Ubicación
Cancel Property Cancelar
@@ -40,6 +40,7 @@ Lock MascotMenu Text when Y is locked. Bloquear
This window of this application MascotMenu Esta ventana de esta aplicación
Fast MascotMenu Rápido
Cancel Mascot Cancelar
{0, plural,one{# second}other{# seconds}} MascotMenu {0, plural,one{# segundo}other{# segundos}}
left MascotMenu izquierda
Fastest MascotMenu Muy rápido
Debug frame visible MascotMenu Mostrar marco de depuración