Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Romanized Urdu translation #26

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions resources/configure-fuzzy-text.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ <h1>Configure Fuzzy Text Int'l</h1>
Svenska
</label>
</div>

<div class="radio">
<label>
<input type="radio" name="lang" value="ur" />
Urdu (Romanized)
</label>
</div>
</fieldset>

<fieldset>
Expand Down
3 changes: 2 additions & 1 deletion src/js/pebble-js-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ var langs = {
es: 4,
fr: 5,
no: 6,
sv: 7
sv: 7,
ur: 8
};

function readyCallback(event) {
Expand Down
7 changes: 7 additions & 0 deletions src/num2words.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "strings-fr.h"
#include "strings-no.h"
#include "strings-sv.h"
#include "strings-ur.h"
#include "string.h"

size_t min(const size_t a, const size_t b) {
Expand Down Expand Up @@ -70,6 +71,9 @@ const char* get_hour(Language lang, int index) {
case SV:
return HOURS_SV[index];
break;
case UR:
return HOURS_UR[index];
break;
default:
return HOURS_EN_US[index];
}
Expand Down Expand Up @@ -98,6 +102,9 @@ const char* get_rel(Language lang, int index) {
case SV:
return RELS_SV[index];
break;
case UR:
return RELS_UR[index];
break;
default:
return RELS_EN_US[index];
}
Expand Down
5 changes: 3 additions & 2 deletions src/num2words.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
#include "string.h"

typedef enum {
CA = 0x0
CA = 0x0,
DE = 0x1,
EN_GB = 0x2,
EN_US = 0x3,
ES = 0x4,
FR = 0x5,
NO = 0x6,
SV = 0x7
SV = 0x7,
UR = 0x8
} Language;

void time_to_words(Language lang, int hours, int minutes, int seconds, char* words, size_t length);
53 changes: 53 additions & 0 deletions src/strings-ur.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#include "strings-ur.h"

const char* const HOURS_UR[] = {
// AM hours
"bara",
"aik",
"do",
"teen",
"chaar",
"paanch",
"chhe",
"saath",
"aath",
"nau",
"das",
"gyara",

// PM hours
"bara",
"aik",
"do",
"teen",
"chaar",
"paanch",
"chhe",
"saath",
"aath",
"nau",
"das",
"gyara"
};

/**
* The string "$1" will be replaced with the current hour (e.g., "three"
* at 3:45). The string "$2" will be replaced with the *next* hour
* (e.g., "four" at 3:45).
*
* A "*" character before a word makes that word bold.
*/
const char* const RELS_UR[] = {
"*$1",
"*$1 baj ke paanch",
"*$1 baj ke das",
"sava *$1",
"*$1 baj ke bees",
"*$1 baj ke pachees",
"sarhe *$1",
"*$2 mein pachees",
"*$2 mein bees",
"paunay *$2",
"*$2 mein das",
"*$2 mein paanch"
};
4 changes: 4 additions & 0 deletions src/strings-ur.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once

const char* const HOURS_UR[24];
const char* const RELS_UR[12];