Skip to content

Commit 347b568

Browse files
committed
translate french bits in the splitwise example
1 parent eab4968 commit 347b568

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

examples/splitwise/group.sql

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@ INSERT INTO group_member(group_id, name)
77
SELECT $id, :new_member_name WHERE :new_member_name IS NOT NULL;
88

99
-- List of members of the group
10-
SELECT 'list' as component, 'Membres' as title;
10+
SELECT 'list' as component, 'Members' as title;
1111
SELECT name AS title FROM group_member WHERE group_id = $id;
1212

1313
-- Form to add a new member to the group
14-
SELECT 'form' as component, 'Ajouter un membre au groupe' as validate;
15-
SELECT 'Nom du membre' AS 'label', 'new_member_name' AS name;
14+
SELECT 'form' as component, 'Add a member to the group' as validate;
15+
SELECT 'Member Name' AS 'label', 'new_member_name' AS name;
1616

17-
SELECT 'title' as component, 'Dépenses' as contents
17+
SELECT 'title' as component, 'Expenses' as contents
1818

1919
-- Form to add an expense
20-
SELECT 'form' as component, 'Ajouter une dépense' as title, 'Ajouter' as validate;
20+
SELECT 'form' as component, 'Add an expense' as title, 'Add' as validate;
2121
SELECT 'Description' AS name;
22-
SELECT 'Montant' AS name, 'number' AS type;
23-
SELECT 'Dépensé par' AS name, 'select' as type,
22+
SELECT 'Amount' AS name, 'number' AS type;
23+
SELECT 'Spent By' AS name, 'select' as type,
2424
json_group_array(json_object("label", name, "value", id)) as options
2525
FROM group_member WHERE group_id = $id;
2626

2727
-- Insert the expense posted by the form into the database
2828
INSERT INTO expense(spent_by, name, amount)
29-
SELECT :"Dépensé par", :Description, :Montant WHERE :Montant IS NOT NULL;
29+
SELECT :"Spent By", :Description, :Amount WHERE :Amount IS NOT NULL;
3030

3131
-- List of expenses of the group
32-
SELECT 'card' as component, 'Dépenses' as title;
32+
SELECT 'card' as component, 'Expenses' as title;
3333
SELECT expense.name as title,
34-
'Par ' || group_member.name || ', le ' || expense.date as description,
34+
'By ' || group_member.name || ', on ' || expense.date as description,
3535
expense.amount || '' as footer,
3636
CASE
3737
WHEN expense.amount > 100 THEN 'red'
@@ -43,6 +43,6 @@ FROM expense
4343
WHERE group_member.group_id = $id;
4444

4545
-- Show the positive and negative debts of each member
46-
SELECT 'chart' AS component, 'Dette par personne' AS title, 'bar' AS type, TRUE AS horizontal;
46+
SELECT 'chart' AS component, 'Debts by Person' AS title, 'bar' AS type, TRUE AS horizontal;
4747
SELECT member_name AS label, is_owed AS value FROM individual_debts
48-
WHERE group_id = $id ORDER BY is_owed DESC;
48+
WHERE group_id = $id ORDER BY is_owed DESC;

examples/splitwise/index.sql

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
21
-- Simple form to create a shared expense account
32
SELECT 'form' as component,
4-
'Nouveau compte partagé' as title,
5-
'Créer le compte de dépenses partagé !' as validate;
6-
SELECT 'Nom du compte' AS label,
3+
'New shared expense account' as title,
4+
'Create the shared expense account!' as validate;
5+
SELECT 'Account Name' AS label,
76
'shared_expense_name' AS name;
87

98
-- Insert the shared expense account posted by the form into the database
@@ -16,4 +15,4 @@ WHERE :shared_expense_name IS NOT NULL;
1615
SELECT 'list' as component;
1716
SELECT name AS title,
1817
'group.sql?id=' || id AS link
19-
FROM expense_group;
18+
FROM expense_group;

examples/splitwise/sqlpage/migrations/0000_schema.sql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ CREATE TABLE group_member(
1010
CREATE TABLE expense(
1111
id INTEGER PRIMARY KEY AUTOINCREMENT,
1212
spent_by INTEGER REFERENCES group_member(id),
13-
-- identifiant du membre qui a fait la dépense
1413
date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
15-
-- date et heure de la dépense
1614
name TEXT,
17-
-- intitulé
18-
amount DECIMAL -- montant en euros
15+
amount DECIMAL
1916
);

0 commit comments

Comments
 (0)