Skip to content

Commit

Permalink
Refactor inventory_unit to support translations for predefined types
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcameron committed Aug 16, 2022
1 parent 43a5586 commit df3e8e8
Show file tree
Hide file tree
Showing 73 changed files with 3,110 additions and 2,559 deletions.
64 changes: 63 additions & 1 deletion client/src/i18n/en/inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"ADD_METADATA": "Add Inventory Item",
"ADD_TYPE": "Add Inventory Type",
"ADD_UNIT": "Add Inventory unit form",
"CANNOT_DELETE_PREDEFINED_UNIT": "Cannot delete predefined inventory units",
"CANNOT_UPDATE_PREDEFINED_UNIT": "Cannot update predefined inventory units",
"CHANGES" : "Changes",
"CODE": "Inventory Code",
"COLUMNS_INFO" : "Note about the columns",
Expand Down Expand Up @@ -67,6 +69,66 @@
"UPLOAD_SUCCESS" : "Successfully Uploaded",
"VIEW_ARTICLES_IN_STOCK" : "View Articles in Stock",
"VIEW_ARTICLE_IN_INVENTORY" : "View Article in Inventory",
"VIEW_LOTS_IN_STOCK" : "View Lots in Stock"
"VIEW_LOTS_IN_STOCK" : "View Lots in Stock",
"UNITS": {
"ACTION": { "TEXT" : "action" , "ABBR" : "act" },
"AMPOULE": { "TEXT" : "ampoule" , "ABBR" : "amp" },
"ARTICLE": { "TEXT" : "article" , "ABBR" : "art" },
"B2": { "TEXT" : "b/2" , "ABBR" : "b/2" },
"B4": { "TEXT" : "b/4" , "ABBR" : "b/4" },
"B5": { "TEXT" : "b/5" , "ABBR" : "b/5" },
"B6": { "TEXT" : "b/6" , "ABBR" : "b/6" },
"B10": { "TEXT" : "b/10" , "ABBR" : "b/10" },
"B12": { "TEXT" : "b/12" , "ABBR" : "b/12" },
"B20": { "TEXT" : "b/20" , "ABBR" : "b/20" },
"B25": { "TEXT" : "b/25" , "ABBR" : "b/25" },
"B30": { "TEXT" : "b/30" , "ABBR" : "b/30" },
"B50": { "TEXT" : "b/50" , "ABBR" : "b/50" },
"B60": { "TEXT" : "b/60" , "ABBR" : "b/60" },
"B100": { "TEXT" : "b/100" , "ABBR" : "b/100" },
"B120": { "TEXT" : "b/120" , "ABBR" : "b/120" },
"B200": { "TEXT" : "b/200" , "ABBR" : "b/200" },
"B250": { "TEXT" : "b/250" , "ABBR" : "b/250" },
"B500": { "TEXT" : "b/500" , "ABBR" : "b/500" },
"B1000": { "TEXT" : "b/1000" , "ABBR" : "b/1000" },
"BAG": { "TEXT" : "bag" , "ABBR" : "bag" },
"BALE": { "TEXT" : "bale" , "ABBR" : "bale" },
"BARREL": { "TEXT" : "barrel" , "ABBR" : "bar" },
"BOTTLE": { "TEXT" : "bottle" , "ABBR" : "btl" },
"BOX": { "TEXT" : "box" , "ABBR" : "box" },
"BUCKET": { "TEXT" : "bucket" , "ABBR" : "bckt" },
"BUNDLE": { "TEXT" : "bundle" , "ABBR" : "bndl" },
"CAN": { "TEXT" : "can" , "ABBR" : "can" },
"CAPSULE": { "TEXT" : "capsule" , "ABBR" : "cap" },
"CARTON": { "TEXT" : "carton" , "ABBR" : "cart" },
"COPY": { "TEXT" : "copy" , "ABBR" : "copy" },
"DAY": { "TEXT" : "day" , "ABBR" : "day" },
"EGG": { "TEXT" : "egg" , "ABBR" : "egg" },
"FLASK": { "TEXT" : "flask" , "ABBR" : "flsk" },
"GLOVES": { "TEXT" : "gloves" , "ABBR" : "glv" },
"INFUSION": { "TEXT" : "infusion" , "ABBR" : "inf" },
"INJECTION": { "TEXT" : "injection" , "ABBR" : "inj" },
"JAR": { "TEXT" : "jar" , "ABBR" : "jar" },
"KIT": { "TEXT" : "kit" , "ABBR" : "kit" },
"LOT": { "TEXT" : "lot" , "ABBR" : "lot" },
"PACKAGE": { "TEXT" : "package" , "ABBR" : "pkg" },
"PACKET": { "TEXT" : "packet" , "ABBR" : "pckt" },
"PAIR": { "TEXT" : "pair" , "ABBR" : "pr" },
"PALLET": { "TEXT" : "pallet" , "ABBR" : "plt" },
"PIECE": { "TEXT" : "piece" , "ABBR" : "pce" },
"PILL": { "TEXT" : "pill" , "ABBR" : "pil" },
"POUCH": { "TEXT" : "pouch" , "ABBR" : "pch" },
"REAM": { "TEXT" : "ream" , "ABBR" : "rm" },
"ROLL": { "TEXT" : "roll" , "ABBR" : "roll" },
"SACK": { "TEXT" : "sack" , "ABBR" : "sack" },
"SET": { "TEXT" : "set" , "ABBR" : "set" },
"SUPPOSITORY": { "TEXT" : "suppository" , "ABBR" : "sup" },
"SYRUP": { "TEXT" : "syrup" , "ABBR" : "srp" },
"TABLET": { "TEXT" : "tablet" , "ABBR" : "tab" },
"TREATMENT": { "TEXT" : "treatment" , "ABBR" : "trt" },
"TUBE": { "TEXT" : "tube" , "ABBR" : "tube" },
"UNIT": { "TEXT" : "unit" , "ABBR" : "unit" },
"VIAL": { "TEXT" : "vial" , "ABBR" : "vial" }
}
}
}
14 changes: 7 additions & 7 deletions client/src/i18n/en/stock.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,22 @@
"LOT_QUANTITY_OVER_GLOBAL": "Total lot quantity is more than the global quantity",
"MISSING_LOT_UNIT_COST": "A non-negative value is required for lot unit cost",
"OVERCONSUMED_INVENTORIES": "Over-consumed inventories",
"OVERCONSUMED_INVENTORIES_DESCRIPTION": "<strong>{{ text }}</strong> with batch number <strong>{{ label }}</strong>, actually only has <strong>{{ quantityAvailable }} {{ unit_type }}</strong> consumption of <strong>{{ quantity }} {{ unit_type }}</strong> will result in a negative inventory quantity",
"OVERCONSUMED_INVENTORIES_DESCRIPTION": "<strong>{{ text }}</strong> with batch number <strong>{{label}}</strong>, actually only has <strong>{{ quantityAvailable }} {{ unit_type }}</strong> consumption of <strong>{{ quantity }} {{ unit_type }}</strong> will result in a negative inventory quantity",
"PLEASE_CHECK_EXPIRY_DATE": "Please check the expiration date",
"PROBLEMATIC_ADJUSTMENT": "Problematic Adjustment",
"PROBLEMATIC_ADJUSTMENT_DESCRIPTION": "Changing the quantity of <strong>{{ text }}</strong> in lot label <strong>{{ label }}</strong> from <strong>{{ old_quantity }}</strong> to <strong>{{ quantity }}</strong> will result in a negative inventory quantity, The quantity currently in stock is <strong>{{ quantityAvailable }}</strong>",
"PROBLEMATIC_ADJUSTMENT_DESCRIPTION": "Changing the quantity of <strong>{{ text }}</strong> in lot label <strong>{{label}}</strong> from <strong>{{ old_quantity }}</strong> to <strong>{{ quantity }}</strong> will result in a negative inventory quantity, The quantity currently in stock is <strong>{{ quantityAvailable }}</strong>",
"POORLY_FORMALIZED_DATE_RANGE": "Poorly formalized date range: one consumption period must not be contained in another",
"QUANTITY_CONSUMED_LOWER" : "Total quantity consumed is lower than the global quantity consumed",
"QUANTITY_CONSUMED_OVER_GLOBAL" : "Total quantity consumed is more than the global quantity consumed",
"QUANTITY_LOST_LOWER" : "Total quantity lost is lower than the global quantity lost",
"QUANTITY_LOST_OVER_GLOBAL" : "Total quantity lost is more than the global quantity lost",
"UNINITIALISED" : "This grid row is empty and uninitialized. Please remove it to submit.",
"LOT_EXPIRED" : "Lot {{ label }} is expired. Its expiration date ({{expiration_date | date }}) is before the selected date.",
"LOT_MISSING_INVENTORY_INFO" : "Lot {{ label }} is missing inventory information. Please select an inventory item to continue.",
"LOT_EXPIRED" : "Lot {{label}} is expired. Its expiration date ({{expiration_date | date }}) is before the selected date.",
"LOT_MISSING_INVENTORY_INFO" : "Lot {{label}} is missing inventory information. Please select an inventory item to continue.",
"LOT_MISSING_LOT_INFO" : "Lot {{ uuid }} is missing lot information. Please select a lot label to continue.",
"LOT_NEGATIVE_QUANTITY" : "Lot {{ label }} has a negative quantity.",
"LOT_OVERCONSUMPTION" : "Lot {{ label }} is over-used. Expected {{quantity}} {{unit}} to be less than {{_quantity_available}} {{ unit }}.",
"LOT_UNUSED" : "Lot {{ label }} isn't used (0 {{ unit }} selected). Please specify a quantity to continue."
"LOT_NEGATIVE_QUANTITY" : "Lot {{label}} has a negative quantity.",
"LOT_OVERCONSUMPTION" : "Lot {{label}} is over-used. Expected {{quantity}} {{unit}} to be less than {{_quantity_available}} {{unit}}.",
"LOT_UNUSED" : "Lot {{label}} isn't used (0 {{unit}} selected). Please specify a quantity to continue."
},
"ENTRY_ADJUSTMENT" : "Positive adjustment of {{numArticles}} articles into {{depot}} by {{user}} .",
"EXIT" : "Stock Exit",
Expand Down
64 changes: 63 additions & 1 deletion client/src/i18n/fr/inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"ADD_METADATA": "Ajouter un inventaire",
"ADD_TYPE": "Ajouter un type d'inventaire",
"ADD_UNIT": "Ajouter une forme d'Inventaire",
"CANNOT_DELETE_PREDEFINED_UNIT": "Les unités d'inventaire prédéfinies ne peuvent pas être supprimées",
"CANNOT_UPDATE_PREDEFINED_UNIT": "Les unités d'inventaire prédéfinies ne peuvent pas être mises à jour",
"CHANGES" : "Changements",
"CODE": "Code de l'inventaire",
"COLUMNS_INFO" : "Note sur les colonnes",
Expand Down Expand Up @@ -67,6 +69,66 @@
"UPLOAD_SUCCESS" : "Téléchargement réussi",
"VIEW_ARTICLES_IN_STOCK" : "Voir les articles en stock",
"VIEW_ARTICLE_IN_INVENTORY" : "Voir l'article dans l'inventaire",
"VIEW_LOTS_IN_STOCK" : "Voir les lots en stock"
"VIEW_LOTS_IN_STOCK" : "Voir les lots en stock",
"UNITS": {
"ACTION": { "TEXT" : "action" , "ABBR" : "act" },
"AMPOULE": { "TEXT" : "ampoulle" , "ABBR" : "amp" },
"ARTICLE": { "TEXT" : "article" , "ABBR" : "art" },
"B2": { "TEXT" : "b/2" , "ABBR" : "b/2" },
"B4": { "TEXT" : "b/4" , "ABBR" : "b/4" },
"B5": { "TEXT" : "b/5" , "ABBR" : "b/5" },
"B6": { "TEXT" : "b/6" , "ABBR" : "b/6" },
"B10": { "TEXT" : "b/10" , "ABBR" : "b/10" },
"B12": { "TEXT" : "b/12" , "ABBR" : "b/12" },
"B20": { "TEXT" : "b/20" , "ABBR" : "b/20" },
"B25": { "TEXT" : "b/25" , "ABBR" : "b/25" },
"B30": { "TEXT" : "b/30" , "ABBR" : "b/30" },
"B50": { "TEXT" : "b/50" , "ABBR" : "b/50" },
"B60": { "TEXT" : "b/60" , "ABBR" : "b/60" },
"B100": { "TEXT" : "b/100" , "ABBR" : "b/100" },
"B120": { "TEXT" : "b/120" , "ABBR" : "b/120" },
"B200": { "TEXT" : "b/200" , "ABBR" : "b/200" },
"B250": { "TEXT" : "b/250" , "ABBR" : "b/250" },
"B500": { "TEXT" : "b/500" , "ABBR" : "b/500" },
"B1000": { "TEXT" : "b/1000" , "ABBR" : "b/1000" },
"BAG": { "TEXT" : "sache" , "ABBR" : "sach" },
"BALE": { "TEXT" : "ballot" , "ABBR" : "ball" },
"BARREL": { "TEXT" : "baril" , "ABBR" : "brl" },
"BOTTLE": { "TEXT" : "bouteille" , "ABBR" : "btl" },
"BOX": { "TEXT" : "boîte" , "ABBR" : "bte" },
"BUCKET": { "TEXT" : "seau" , "ABBR" : "seau" },
"BUNDLE": { "TEXT" : "faisceau" , "ABBR" : "fais" },
"CAN": { "TEXT" : "bidon" , "ABBR" : "bdn" },
"CAPSULE": { "TEXT" : "capsule" , "ABBR" : "cap" },
"CARTON": { "TEXT" : "carton" , "ABBR" : "cart" },
"COPY": { "TEXT" : "exemplaire" , "ABBR" : "exmp" },
"DAY": { "TEXT" : "jour" , "ABBR" : "jr" },
"EGG": { "TEXT" : "ovule" , "ABBR" : "ov" },
"FLASK": { "TEXT" : "flacon" , "ABBR" : "flc" },
"GLOVES": { "TEXT" : "gants" , "ABBR" : "gnts" },
"INFUSION": { "TEXT" : "infusion" , "ABBR" : "inf" },
"INJECTION": { "TEXT" : "injection" , "ABBR" : "inj" },
"JAR": { "TEXT" : "jar" , "ABBR" : "jar" },
"KIT": { "TEXT" : "kit" , "ABBR" : "kit" },
"LOT": { "TEXT" : "lot" , "ABBR" : "lot" },
"PACKAGE": { "TEXT" : "colis" , "ABBR" : "col" },
"PACKET": { "TEXT" : "paquet" , "ABBR" : "pqt" },
"PAIR": { "TEXT" : "paire" , "ABBR" : "pr" },
"PALLET": { "TEXT" : "pallete" , "ABBR" : "plt" },
"PIECE": { "TEXT" : "pièce" , "ABBR" : "pce" },
"PILL": { "TEXT" : "pillule" , "ABBR" : "pil" },
"POUCH": { "TEXT" : "sachet" , "ABBR" : "sach" },
"REAM": { "TEXT" : "rame" , "ABBR" : "rm" },
"ROLL": { "TEXT" : "roleau" , "ABBR" : "rol" },
"SACK": { "TEXT" : "sac" , "ABBR" : "sac" },
"SET": { "TEXT" : "jeu" , "ABBR" : "jeu" },
"SUPPOSITORY": { "TEXT" : "suppositoire" , "ABBR" : "sup" },
"SYRUP": { "TEXT" : "sirop" , "ABBR" : "srp" },
"TABLET": { "TEXT" : "coprimé" , "ABBR" : "cpé" },
"TREATMENT": { "TEXT" : "cure" , "ABBR" : "cure" },
"TUBE": { "TEXT" : "tube" , "ABBR" : "tube" },
"UNIT": { "TEXT" : "unité" , "ABBR" : "unit" },
"VIAL": { "TEXT" : "vial" , "ABBR" : "vial" }
}
}
}
14 changes: 7 additions & 7 deletions client/src/i18n/fr/stock.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,22 @@
"LOT_QUANTITY_OVER_GLOBAL": "La quantité totale des lots dépasse la quantity globale fournie",
"MISSING_LOT_UNIT_COST": "Une valeur non négative est requise pour le coût unitaire du lot",
"OVERCONSUMED_INVENTORIES": "Inventaires surconsommés",
"OVERCONSUMED_INVENTORIES_DESCRIPTION": "La sortie de stock de l'inventaire <strong>{{ text }}</strong> dans lot <strong>{{ label }}</strong> de <strong>{{ quantity }} {{ unit_type }}</strong> entraînera une quantité d'inventaire négative car la quantité actuellement en stock n'est que de <strong>{{ quantityAvailable }} {{ unit_type }}</strong>",
"OVERCONSUMED_INVENTORIES_DESCRIPTION": "La sortie de stock de l'inventaire <strong>{{ text }}</strong> dans lot <strong>{{label}}</strong> de <strong>{{ quantity }} {{ unit_type }}</strong> entraînera une quantité d'inventaire négative car la quantité actuellement en stock n'est que de <strong>{{ quantityAvailable }} {{ unit_type }}</strong>",
"PLEASE_CHECK_EXPIRY_DATE": "Veuillez vérifier la date d'expiration",
"PROBLEMATIC_ADJUSTMENT": "Ajustement problematique",
"PROBLEMATIC_ADJUSTMENT_DESCRIPTION": "L'ajustement de la quantité de l'inventaire <strong>{{ text }}</strong> dans le lot <strong>{{ label }}</strong> de <strong>{{ old_quantity }}</strong> à <strong>{{ quantity }}</strong> entraînera une quantité d'inventaire négative, la quantité actuellement en stock n'est que de <strong>{{ quantityAvailable }}</strong>",
"PROBLEMATIC_ADJUSTMENT_DESCRIPTION": "L'ajustement de la quantité de l'inventaire <strong>{{ text }}</strong> dans le lot <strong>{{label}}</strong> de <strong>{{ old_quantity }}</strong> à <strong>{{ quantity }}</strong> entraînera une quantité d'inventaire négative, la quantité actuellement en stock n'est que de <strong>{{ quantityAvailable }}</strong>",
"POORLY_FORMALIZED_DATE_RANGE": "Plages des dates males formalisées: une période de consommation ne doit pas être contenue dans une autre",
"QUANTITY_CONSUMED_LOWER" : "La quantité totale consommé est inférieure à la quantity globale consommée",
"QUANTITY_CONSUMED_OVER_GLOBAL" : "La quantité totale consommé dépasse la quantity globale consommée",
"QUANTITY_LOST_LOWER" : "La quantité totale perdue est inférieure à la quantity globale perdue",
"QUANTITY_LOST_OVER_GLOBAL" : "La quantité totale perdue dépasse la quantity globale perdue",
"UNINITIALISED" : "Cette ligne de grille est vide et non initialisée. Veuillez le supprimer pour le soumettre.",
"LOT_EXPIRED" : "Lot {{ label }} est expiré. Sa date d'expiration ({{expiration_date | date }}) précède la date selectionnée.",
"LOT_MISSING_INVENTORY_INFO" : "Lot {{ label }} manque les informations d'inventaire. Veuillez selectionner l'inventaire pour continuer.",
"LOT_EXPIRED" : "Lot {{label}} est expiré. Sa date d'expiration ({{expiration_date | date }}) précède la date selectionnée.",
"LOT_MISSING_INVENTORY_INFO" : "Lot {{label}} manque les informations d'inventaire. Veuillez selectionner l'inventaire pour continuer.",
"LOT_MISSING_LOT_INFO" : "Lot {{ uuid }} manque les informations de lot. Veuillez selectionner le libellé du lot pour continuer.",
"LOT_NEGATIVE_QUANTITY" : "Lot {{ label }} a une quantité négative.",
"LOT_OVERCONSUMPTION" : "Lot {{ label }} est sur-utilisé. Attendu {{quantity}} {{unit}} doit être moins que {{_quantity_available}} {{ unit }}.",
"LOT_UNUSED" : "Lot {{ label }} n'est pas utilisé (0 {{ unit }} séléctionné). Veuillez spécifier une quantité pour continuer."
"LOT_NEGATIVE_QUANTITY" : "Lot {{label}} a une quantité négative.",
"LOT_OVERCONSUMPTION" : "Lot {{label}} est sur-utilisé. Attendu {{quantity}} {{unit}} doit être moins que {{_quantity_available}} {{unit}}.",
"LOT_UNUSED" : "Lot {{label}} n'est pas utilisé (0 {{unit}} séléctionné). Veuillez spécifier une quantité pour continuer."
},
"ENTRY_ADJUSTMENT" : "Ajustement positif de {{numArticles}} articles de dans {{depot}} par {{user}}.",
"EXIT" : "Sortie de stock",
Expand Down
4 changes: 2 additions & 2 deletions client/src/js/services/LanguageService.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ angular.module('bhima.services')
.service('LanguageService', LanguageService);

LanguageService.$inject = [
'$http', '$q', 'util', 'AppCache', '$translate', 'tmhDynamicLocale', 'amMoment'
'$http', '$q', 'util', 'AppCache', '$translate', 'tmhDynamicLocale', 'amMoment',
];

/**
* Language Service
*
* A cross-controller service to manage lanuages throughout the application.
* A cross-controller service to manage languages throughout the application.
* Supports getter and setter methods.
* @constructor
*/
Expand Down
Loading

0 comments on commit df3e8e8

Please sign in to comment.