# HG changeset patch # User Michiel Broek # Date 1655795339 -7200 # Node ID 2e84622193328d9a0557b2d5e5ea35fa34e5d389 # Parent fe6346211b5b1af740d7e1bb7af03b791a6f9b15 Export recipe or product to beerxml use the global untranslated arrays. Export recipe or product to forum use the global translated arrays. diff -r fe6346211b5b -r 2e8462219332 src/EditProductExport.cpp --- a/src/EditProductExport.cpp Mon Jun 20 19:55:23 2022 +0200 +++ b/src/EditProductExport.cpp Tue Jun 21 09:08:59 2022 +0200 @@ -22,24 +22,15 @@ { qDebug() << "export"; - const QStringList styletype({ "Lager", "Ale", "Mead", "Wheat", "Mixed", "Cider" }); - const QStringList producttypes({ "Extract", "Partial Mash", "All Grain" }); const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" }); - const QStringList hop_types({ "Bittering", "Aroma", "Both" }); const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet", "Pellet" }); /* "Leaf Wet", "Cryo", "Extract" */ /* We use more hop forms then beerxml knows about, so we send known names */ /* instead of what we internally use. */ const QStringList hop_use({ "Mash", "First wort", "Boil", "Aroma", "Whirlpool", "Dry hop", "Dry hop" }); // tetra == dry-hop :( - const QStringList fermentable_type({ "Grain", "Sugar", "Extract", "Dry extract", "Adjunct" }); - const QStringList fermentable_graintype({ "Base", "Roast", "Crystal", "Kilned", "Sour malt", "Special", "No malt" }); const QStringList yeast_type({ "Lager", "Ale", "Wheat", "Wine", "Champagne", "Other", "Other", "Other", "Other", "Other" }); const QStringList yeast_form({ "Liquid", "Dry", "Slant", "Culture", "Frozen", "Bottle", "Dry" }); - const QStringList yeast_use({ "Primary", "Secondary", "Tertiary", "Bottle" }); - const QStringList misc_type({ "Spice", "Herb", "Flavor", "Fining", "Water agent", "Yeast nutrient", "Other" }); - const QStringList misc_use({ "Starter", "Mash", "Boil", "Primary", "Secondary", "Bottling" }); - const QStringList step_type({ "Infusion", "Temperature", "Decoction" }); QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), QDir::homePath() + "/" + product->code + " " + product->name + ".xml", tr("Files (*.xml)")); @@ -65,7 +56,7 @@ xmlWriter->writeTextElement("NAME", product->name); if (product->notes != "") xmlWriter->writeTextElement("NOTES", product->notes); - xmlWriter->writeTextElement("TYPE", producttypes[product->type]); + xmlWriter->writeTextElement("TYPE", g_recipe_types[product->type]); xmlWriter->writeTextElement("BREWER", "Anonymous"); xmlWriter->writeTextElement("BATCH_SIZE", QString::number(product->batch_size, 'f', 4)); xmlWriter->writeTextElement("BOIL_SIZE", QString::number(product->boil_size, 'f', 4)); @@ -96,7 +87,7 @@ xmlWriter->writeTextElement("CATEGORY_NUMBER", QString::number(product->st_category_number, 'f', 0)); xmlWriter->writeTextElement("STYLE_LETTER", product->st_letter); xmlWriter->writeTextElement("STYLE_GUIDE", product->st_guide); - xmlWriter->writeTextElement("TYPE", styletype[product->st_type]); + xmlWriter->writeTextElement("TYPE", g_style_types[product->st_type]); xmlWriter->writeTextElement("OG_MIN", QString::number(product->st_og_min, 'f', 3)); xmlWriter->writeTextElement("OG_MAX", QString::number(product->st_og_max, 'f', 3)); xmlWriter->writeTextElement("FG_MIN", QString::number(product->st_fg_min, 'f', 3)); @@ -129,7 +120,7 @@ xmlWriter->writeTextElement("AMOUNT", QString::number(product->hops.at(i).amount, 'f', 4)); xmlWriter->writeTextElement("USE", hop_use[product->hops.at(i).useat]); xmlWriter->writeTextElement("TIME", QString::number(product->hops.at(i).time, 'f', 0)); - xmlWriter->writeTextElement("TYPE", hop_types[product->hops.at(i).type]); + xmlWriter->writeTextElement("TYPE", g_hop_types[product->hops.at(i).type]); xmlWriter->writeTextElement("FORM", hop_forms[product->hops.at(i).form]); xmlWriter->writeTextElement("BETA", QString::number(product->hops.at(i).beta, 'f', 1)); xmlWriter->writeTextElement("HSI", QString::number(product->hops.at(i).hsi, 'f', 1)); @@ -144,7 +135,7 @@ xmlWriter->writeStartElement("FERMENTABLE"); xmlWriter->writeTextElement("VERSION", "1"); xmlWriter->writeTextElement("NAME", product->fermentables.at(i).name); - xmlWriter->writeTextElement("TYPE", fermentable_type[product->fermentables.at(i).type]); + xmlWriter->writeTextElement("TYPE", g_fermentable_types[product->fermentables.at(i).type]); xmlWriter->writeTextElement("AMOUNT", QString::number(product->fermentables.at(i).amount, 'f', 4)); xmlWriter->writeTextElement("YIELD", QString::number(product->fermentables.at(i).yield, 'f', 1)); xmlWriter->writeTextElement("COLOR", QString::number(Utils::ebc_to_srm(product->fermentables.at(i).color), 'f', 1)); @@ -162,7 +153,7 @@ if (product->fermentables.at(i).max_in_batch) xmlWriter->writeTextElement("MAX_IN_BATCH", QString::number(product->fermentables.at(i).max_in_batch, 'f', 1)); xmlWriter->writeTextElement("RECOMMEND_MASH", product->fermentables.at(i).recommend_mash ? "TRUE":"FALSE"); - xmlWriter->writeTextElement("GRAINTYPE", fermentable_graintype[product->fermentables.at(i).graintype]); + xmlWriter->writeTextElement("GRAINTYPE", g_fermentable_graintypes[product->fermentables.at(i).graintype]); xmlWriter->writeEndElement(); } } @@ -173,10 +164,10 @@ xmlWriter->writeStartElement("MISC"); xmlWriter->writeTextElement("VERSION", "1"); xmlWriter->writeTextElement("NAME", product->miscs.at(i).name); - xmlWriter->writeTextElement("TYPE", misc_type[product->miscs.at(i).type]); + xmlWriter->writeTextElement("TYPE", g_misc_types[product->miscs.at(i).type]); xmlWriter->writeTextElement("AMOUNT", QString::number(product->miscs.at(i).amount, 'f', 5)); xmlWriter->writeTextElement("AMOUNT_IS_WEIGHT", product->miscs.at(i).amount_is_weight ? "TRUE":"FALSE"); - xmlWriter->writeTextElement("USE", misc_use[product->miscs.at(i).use_use]); + xmlWriter->writeTextElement("USE", g_misc_uses[product->miscs.at(i).use_use]); xmlWriter->writeTextElement("TIME", QString::number(product->miscs.at(i).time, 'f', 0)); xmlWriter->writeEndElement(); } @@ -245,7 +236,7 @@ xmlWriter->writeStartElement("MASH_STEP"); xmlWriter->writeTextElement("VERSION", "1"); xmlWriter->writeTextElement("NAME", product->mashs.at(i).step_name); - xmlWriter->writeTextElement("TYPE", step_type[product->mashs.at(i).step_type]); + xmlWriter->writeTextElement("TYPE", g_step_types[product->mashs.at(i).step_type]); if (product->mashs.at(i).step_type == 0) { xmlWriter->writeTextElement("INFUSE_AMOUNT", QString::number(product->mashs.at(i).step_infuse_amount, 'f', 3)); xmlWriter->writeTextElement("INFUSE_TEMP", QString::number(product->mashs.at(i).step_infuse_temp, 'f', 3)); @@ -425,17 +416,8 @@ void EditProduct::toforumProduct() { - const QStringList recipetypes({ "Extract", "Partial Mash", "All Grain" }); const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" }); - const QStringList fermentable_added({ "Maischen", "Koken", "Hoofd/nagisting", "Lageren", "Bottelen", "Fusten" }); - const QStringList hop_forms({ "Pellet", "Plug", "Bloemen", "Verse hop", "Cryo", "Extract" }); - const QStringList hop_use({ "Maischen", "First wort", "Koken", "Vlamuit", "Whirlpool", "Drooghop", "Bottelen" }); - const QStringList misc_type({ "Spice", "Herb", "Smaakstof", "Klaren", "Brouwzout", "Gist voeding", "Overig" }); - const QStringList misc_use({ "Starter", "Maischen", "Koken", "Hoofdgisting", "Nagisting", "Bottelen" }); - const QStringList yeast_form({ "Vloeibaar", "Droog", "Schuine buis", "Opkweek", "Ingevroren", "Flesbodem", "Gedroogd" }); - const QStringList yeast_use({ "Hoofdgisting", "Nagisting", "Lageren", "Bottelen", "Fusten" }); - const QStringList step_type({ "Infusie", "Verwarmen", "Decoctie" }); QString memo = QString("[u][b]BMSapp v"); memo.append(VERSIONSTRING); // For some stupid reason this must be on it's own. @@ -444,7 +426,7 @@ memo.append("[head]Omschrijving[/head][head]Waarde[/head]\n"); memo.append("[row][data]Bier naam[/data][data]" + product->name + "[/data][/row]\n"); memo.append("[row][data]Bier stijl[/data][data]" + product->st_name + "[/data][/row]\n"); - memo.append("[row][data]Recept type[/data][data]" + recipetypes[product->type] + "[/data][/row]\n"); + memo.append("[row][data]Recept type[/data][data]" + QCoreApplication::translate("RecipeType", g_recipe_types[product->type]) + "[/data][/row]\n"); memo.append("[row][data]Batch grootte[/data][data]" + QString::number(product->batch_size, 'f', 1) + " L[/data][/row]\n"); memo.append("[row][data]Kooktijd[/data][data]" + QString::number(product->boil_time, 'f', 0) + " minuten[/data][/row]\n"); memo.append("[row][data]Brouwzaal rendement[/data][data]" + QString::number(product->efficiency, 'f', 1) + "%[/data][/row]\n"); @@ -463,7 +445,7 @@ memo.append("[data]" + QString::number(product->fermentables.at(i).color) + "[/data]"); memo.append("[data]" + QString::number(product->fermentables.at(i).amount, 'f', 3) + "[/data]"); memo.append("[data]" + QString::number(product->fermentables.at(i).percentage, 'f', 1) + "[/data]"); - memo.append("[data]" + fermentable_added[product->fermentables.at(i).added] + "[/data][/row]\n"); + memo.append("[data]" + QCoreApplication::translate("FermentableAdded", g_fermentable_added[product->fermentables.at(i).added]) + "[/data][/row]\n"); } memo.append("[/tabular]\n\n"); @@ -475,16 +457,16 @@ product->hops.at(i).amount, product->hops.at(i).time, product->hops.at(i).alpha, product->ibu_method, product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time); memo.append("[row][data]" + product->hops.at(i).name + " (" + product->hops.at(i).origin + ")[/data]"); - memo.append("[data]" + hop_forms[product->hops.at(i).form] + "[/data]"); + memo.append("[data]" + QCoreApplication::translate("HopForm", g_hop_forms[product->hops.at(i).form]) + "[/data]"); memo.append("[data]" + QString::number(product->hops.at(i).alpha, 'f', 1) + "[/data]"); memo.append("[data]" + QString::number(ibu, 'f', 1) + "[/data]"); memo.append("[data]" + QString::number(product->hops.at(i).amount * 1000, 'f', 2) + "[/data]"); if (product->hops.at(i).useat == HOP_USEAT_BOIL || product->hops.at(i).useat == HOP_USEAT_WHIRLPOOL) - memo.append("[data]" + hop_use[product->hops.at(i).useat] + " " + QString::number(product->hops.at(i).time) + " minuten[/data][/row]\n"); + memo.append("[data]" + QCoreApplication::translate("HopUse", g_hop_useat[product->hops.at(i).useat]) + " " + QString::number(product->hops.at(i).time) + " minuten[/data][/row]\n"); else if (product->hops.at(i).useat == HOP_USEAT_DRY_HOP) - memo.append("[data]" + hop_use[product->hops.at(i).useat] + " " + QString::number(product->hops.at(i).time / 1440) + " dagen[/data][/row]\n"); + memo.append("[data]" + QCoreApplication::translate("HopUse", g_hop_useat[product->hops.at(i).useat]) + " " + QString::number(product->hops.at(i).time / 1440) + " dagen[/data][/row]\n"); else - memo.append("[data]" + hop_use[product->hops.at(i).useat] + "[/data][/row]\n"); + memo.append("[data]" + QCoreApplication::translate("HopUse", g_hop_useat[product->hops.at(i).useat]) + "[/data][/row]\n"); } memo.append("[/tabular]\n\n"); @@ -493,11 +475,11 @@ memo.append("[head]Specerij, kruid, brouwzout[/head][head]Type grondstof[/head][head]Gebruik tijdens[/head][head]Hoeveel[/head]\n"); for (int i = 0; i < product->miscs.size(); i++) { memo.append("[row][data]" + product->miscs.at(i).name + "[/data]"); - memo.append("[data]" + misc_type[product->miscs.at(i).type] + "[/data]"); + memo.append("[data]" + QCoreApplication::translate("MiscType", g_misc_types[product->miscs.at(i).type]) + "[/data]"); if (product->miscs.at(i).use_use == MISC_USES_BOIL) - memo.append("[data]" + misc_use[product->miscs.at(i).use_use] + " " + QString::number(product->miscs.at(i).time) + " min[/data]"); + memo.append("[data]" + QCoreApplication::translate("MiscUse", g_misc_uses[product->miscs.at(i).use_use]) + " " + QString::number(product->miscs.at(i).time) + " min[/data]"); else - memo.append("[data]" + misc_use[product->miscs.at(i).use_use] + "[/data]"); + memo.append("[data]" + QCoreApplication::translate("MiscUse", g_misc_uses[product->miscs.at(i).use_use]) + "[/data]"); memo.append("[data]"+QString::number(product->miscs.at(i).amount * 1000, 'f', 2)+((product->miscs.at(i).amount_is_weight)?" gr":" ml")+"[/data][/row]\n"); } memo.append("[/tabular]\n\n"); @@ -508,8 +490,8 @@ for (int i = 0; i < product->yeasts.size(); i++) { memo.append("[row][data]" + product->yeasts.at(i).laboratory + " " + product->yeasts.at(i).product_id + "[/data]"); memo.append("[data]" + product->yeasts.at(i).name + "[/data]"); - memo.append("[data]" + yeast_use[product->yeasts.at(i).use] + "[/data]"); - memo.append("[data]" + yeast_form[product->yeasts.at(i).form] + "[/data]"); + memo.append("[data]" + QCoreApplication::translate("YeastUse", g_yeast_use[product->yeasts.at(i).use]) + "[/data]"); + memo.append("[data]" + QCoreApplication::translate("YeastForm", g_yeast_forms[product->yeasts.at(i).form]) + "[/data]"); if (product->yeasts.at(i).form == YEAST_FORMS_LIQUID) memo.append("[data]" + QString::number(product->yeasts.at(i).amount, 'f', 0) + " pak[/data][/row]\n"); else if (product->yeasts.at(i).form == YEAST_FORMS_DRY || product->yeasts.at(i).form == YEAST_FORMS_DRIED) @@ -534,9 +516,9 @@ for (int i = 0; i < product->mashs.size(); i++) { memo.append("[row][data]" + product->mashs.at(i).step_name + "[/data]"); if (product->mashs.at(i).step_type != 1) - memo.append("[data]" + step_type[product->mashs.at(i).step_type]+" "+QString::number(product->mashs.at(i).step_infuse_amount, 'f', 1) + " L[/data]"); + memo.append("[data]" + QCoreApplication::translate("StepType", g_step_types[product->mashs.at(i).step_type])+" "+QString::number(product->mashs.at(i).step_infuse_amount, 'f', 1) + " L[/data]"); else - memo.append("[data]" + step_type[product->mashs.at(i).step_type] + "[/data]"); + memo.append("[data]" + QCoreApplication::translate("StepType", g_step_types[product->mashs.at(i).step_type]) + "[/data]"); memo.append("[data]" + QString::number(product->mashs.at(i).step_temp, 'f', 1) + " °C[/data]"); memo.append("[data]" + QString::number(product->mashs.at(i).step_time, 'f', 0) + " min[/data]"); memo.append("[data]" + QString::number(product->mashs.at(i).ramp_time, 'f', 0) + " min[/data][/row]\n"); diff -r fe6346211b5b -r 2e8462219332 src/EditRecipeExport.cpp --- a/src/EditRecipeExport.cpp Mon Jun 20 19:55:23 2022 +0200 +++ b/src/EditRecipeExport.cpp Tue Jun 21 09:08:59 2022 +0200 @@ -20,24 +20,15 @@ void EditRecipe::exportBeerXML() { - const QStringList styletype({ "Lager", "Ale", "Mead", "Wheat", "Mixed", "Cider" }); - const QStringList recipetypes({ "Extract", "Partial Mash", "All Grain" }); const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" }); - const QStringList hop_types({ "Bittering", "Aroma", "Both" }); const QStringList hop_forms({ "Pellet", "Plug", "Leaf", "Leaf", "Pellet", "Pellet" }); /* "Leaf Wet", "Cryo", "Extract" */ /* We use more hop forms then beerxml knows about, so we send known names */ /* instead of what we internally use. */ const QStringList hop_use({ "Mash", "First wort", "Boil", "Aroma", "Whirlpool", "Dry hop", "Dry hop" }); - const QStringList fermentable_type({ "Grain", "Sugar", "Extract", "Dry extract", "Adjunct" }); - const QStringList fermentable_graintype({ "Base", "Roast", "Crystal", "Kilned", "Sour malt", "Special", "No malt" }); const QStringList yeast_type({ "Lager", "Ale", "Wheat", "Wine", "Champagne", "Other", "Other", "Other", "Other", "Other" }); const QStringList yeast_form({ "Liquid", "Dry", "Slant", "Culture", "Frozen", "Bottle", "Dry" }); - const QStringList yeast_use({ "Primary", "Secondary", "Tertiary", "Bottle" }); - const QStringList misc_type({ "Spice", "Herb", "Flavor", "Fining", "Water agent", "Yeast nutrient", "Other" }); - const QStringList misc_use({ "Starter", "Mash", "Boil", "Primary", "Secondary", "Bottling" }); - const QStringList step_type({ "Infusion", "Temperature", "Decoction" }); QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), QDir::homePath() + "/" + recipe->name + ".xml", tr("Files (*.xml)")); if (fileName == 0) { @@ -63,7 +54,7 @@ xmlWriter->writeTextElement("NAME", recipe->name); if (recipe->notes != "") xmlWriter->writeTextElement("NOTES", recipe->notes); - xmlWriter->writeTextElement("TYPE", recipetypes[recipe->type]); + xmlWriter->writeTextElement("TYPE", g_recipe_types[recipe->type]); xmlWriter->writeTextElement("BREWER", "Anonymous"); xmlWriter->writeTextElement("BATCH_SIZE", QString::number(recipe->batch_size, 'f', 4)); xmlWriter->writeTextElement("BOIL_SIZE", QString::number(recipe->boil_size, 'f', 4)); @@ -89,7 +80,7 @@ xmlWriter->writeTextElement("CATEGORY_NUMBER", QString::number(recipe->st_category_number, 'f', 0)); xmlWriter->writeTextElement("STYLE_LETTER", recipe->st_letter); xmlWriter->writeTextElement("STYLE_GUIDE", recipe->st_guide); - xmlWriter->writeTextElement("TYPE", styletype[recipe->st_type]); + xmlWriter->writeTextElement("TYPE", g_style_types[recipe->st_type]); xmlWriter->writeTextElement("OG_MIN", QString::number(recipe->st_og_min, 'f', 3)); xmlWriter->writeTextElement("OG_MAX", QString::number(recipe->st_og_max, 'f', 3)); xmlWriter->writeTextElement("FG_MIN", QString::number(recipe->st_fg_min, 'f', 3)); @@ -121,7 +112,7 @@ xmlWriter->writeTextElement("AMOUNT", QString::number(recipe->hops.at(i).amount, 'f', 4)); xmlWriter->writeTextElement("USE", hop_use[recipe->hops.at(i).useat]); xmlWriter->writeTextElement("TIME", QString::number(recipe->hops.at(i).time, 'f', 0)); - xmlWriter->writeTextElement("TYPE", hop_types[recipe->hops.at(i).type]); + xmlWriter->writeTextElement("TYPE", g_hop_types[recipe->hops.at(i).type]); xmlWriter->writeTextElement("FORM", hop_forms[recipe->hops.at(i).form]); xmlWriter->writeTextElement("BETA", QString::number(recipe->hops.at(i).beta, 'f', 1)); xmlWriter->writeTextElement("HSI", QString::number(recipe->hops.at(i).hsi, 'f', 1)); @@ -135,7 +126,7 @@ xmlWriter->writeStartElement("FERMENTABLE"); xmlWriter->writeTextElement("VERSION", "1"); xmlWriter->writeTextElement("NAME", recipe->fermentables.at(i).name); - xmlWriter->writeTextElement("TYPE", fermentable_type[recipe->fermentables.at(i).type]); + xmlWriter->writeTextElement("TYPE", g_fermentable_types[recipe->fermentables.at(i).type]); xmlWriter->writeTextElement("AMOUNT", QString::number(recipe->fermentables.at(i).amount, 'f', 4)); xmlWriter->writeTextElement("YIELD", QString::number(recipe->fermentables.at(i).yield, 'f', 1)); xmlWriter->writeTextElement("COLOR", QString::number(Utils::ebc_to_srm(recipe->fermentables.at(i).color), 'f', 1)); @@ -153,7 +144,7 @@ if (recipe->fermentables.at(i).max_in_batch) xmlWriter->writeTextElement("MAX_IN_BATCH", QString::number(recipe->fermentables.at(i).max_in_batch, 'f', 1)); xmlWriter->writeTextElement("RECOMMEND_MASH", recipe->fermentables.at(i).recommend_mash ? "TRUE":"FALSE"); - xmlWriter->writeTextElement("GRAINTYPE", fermentable_graintype[recipe->fermentables.at(i).graintype]); + xmlWriter->writeTextElement("GRAINTYPE", g_fermentable_graintypes[recipe->fermentables.at(i).graintype]); xmlWriter->writeEndElement(); } xmlWriter->writeEndElement(); // FERMENTABLES @@ -163,10 +154,10 @@ xmlWriter->writeStartElement("MISC"); xmlWriter->writeTextElement("VERSION", "1"); xmlWriter->writeTextElement("NAME", recipe->miscs.at(i).name); - xmlWriter->writeTextElement("TYPE", misc_type[recipe->miscs.at(i).type]); + xmlWriter->writeTextElement("TYPE", g_misc_types[recipe->miscs.at(i).type]); xmlWriter->writeTextElement("AMOUNT", QString::number(recipe->miscs.at(i).amount, 'f', 5)); xmlWriter->writeTextElement("AMOUNT_IS_WEIGHT", recipe->miscs.at(i).amount_is_weight ? "TRUE":"FALSE"); - xmlWriter->writeTextElement("USE", misc_use[recipe->miscs.at(i).use_use]); + xmlWriter->writeTextElement("USE", g_misc_uses[recipe->miscs.at(i).use_use]); xmlWriter->writeTextElement("TIME", QString::number(recipe->miscs.at(i).time, 'f', 0)); xmlWriter->writeEndElement(); } @@ -235,7 +226,7 @@ xmlWriter->writeStartElement("MASH_STEP"); xmlWriter->writeTextElement("VERSION", "1"); xmlWriter->writeTextElement("NAME", recipe->mashs.at(i).step_name); - xmlWriter->writeTextElement("TYPE", step_type[recipe->mashs.at(i).step_type]); + xmlWriter->writeTextElement("TYPE", g_step_types[recipe->mashs.at(i).step_type]); if (recipe->mashs.at(i).step_type == 0) { xmlWriter->writeTextElement("INFUSE_AMOUNT", QString::number(recipe->mashs.at(i).step_infuse_amount, 'f', 3)); xmlWriter->writeTextElement("INFUSE_TEMP", QString::number(recipe->mashs.at(i).step_infuse_temp, 'f', 3)); @@ -442,17 +433,8 @@ void EditRecipe::toforumRecipe() { - const QStringList recipetypes({ "Extract", "Partial Mash", "All Grain" }); const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" }); - const QStringList fermentable_added({ "Maischen", "Koken", "Hoofd/nagisting", "Lageren", "Bottelen", "Fusten" }); - const QStringList hop_forms({ "Pellet", "Plug", "Bloemen", "Verse hop", "Cryo", "Extract" }); - const QStringList hop_use({ "Maischen", "First wort", "Koken", "Vlamuit", "Whirlpool", "Drooghop", "Bottelen" }); - const QStringList misc_type({ "Spice", "Herb", "Smaakstof", "Klaren", "Brouwzout", "Gist voeding", "Overig" }); - const QStringList misc_use({ "Starter", "Maischen", "Koken", "Hoofdgisting", "Nagisting", "Bottelen" }); - const QStringList yeast_form({ "Vloeibaar", "Droog", "Schuine buis", "Opkweek", "Ingevroren", "Flesbodem", "Gedroogd" }); - const QStringList yeast_use({ "Hoofdgisting", "Nagisting", "Lageren", "Bottelen", "Fusten" }); - const QStringList step_type({ "Infusie", "Verwarmen", "Decoctie" }); QString memo = QString("[u][b]BMSapp v"); memo.append(VERSIONSTRING); // For some stupid reason this must be on it's own. @@ -461,7 +443,7 @@ memo.append("[head]Omschrijving[/head][head]Waarde[/head]\n"); memo.append("[row][data]Bier naam[/data][data]" + recipe->name + "[/data][/row]\n"); memo.append("[row][data]Bier stijl[/data][data]" + recipe->st_name + "[/data][/row]\n"); - memo.append("[row][data]Recept type[/data][data]" + recipetypes[recipe->type] + "[/data][/row]\n"); + memo.append("[row][data]Recept type[/data][data]" + QCoreApplication::translate("RecipeType", g_recipe_types[recipe->type]) + "[/data][/row]\n"); memo.append("[row][data]Batch grootte[/data][data]" + QString::number(recipe->batch_size, 'f', 1) + " L[/data][/row]\n"); memo.append("[row][data]Kooktijd[/data][data]" + QString::number(recipe->boil_time, 'f', 0) + " minuten[/data][/row]\n"); memo.append("[row][data]Brouwzaal rendement[/data][data]" + QString::number(recipe->efficiency, 'f', 1) + "%[/data][/row]\n"); @@ -480,7 +462,7 @@ memo.append("[data]" + QString::number(recipe->fermentables.at(i).color) + "[/data]"); memo.append("[data]" + QString::number(recipe->fermentables.at(i).amount, 'f', 3) + "[/data]"); memo.append("[data]" + QString::number(recipe->fermentables.at(i).percentage, 'f', 1) + "[/data]"); - memo.append("[data]" + fermentable_added[recipe->fermentables.at(i).added] + "[/data][/row]\n"); + memo.append("[data]" + QCoreApplication::translate("FermentableAdded", g_fermentable_added[recipe->fermentables.at(i).added]) + "[/data][/row]\n"); } memo.append("[/tabular]\n\n"); @@ -492,16 +474,16 @@ recipe->hops.at(i).amount, recipe->hops.at(i).time, recipe->hops.at(i).alpha, recipe->ibu_method, 0, recipe->hops.at(i).time, 0, recipe->boil_time); memo.append("[row][data]" + recipe->hops.at(i).name + " (" + recipe->hops.at(i).origin + ")[/data]"); - memo.append("[data]" + hop_forms[recipe->hops.at(i).form] + "[/data]"); + memo.append("[data]" + QCoreApplication::translate("HopForm", g_hop_forms[recipe->hops.at(i).form]) + "[/data]"); memo.append("[data]" + QString::number(recipe->hops.at(i).alpha, 'f', 1) + "[/data]"); memo.append("[data]" + QString::number(ibu, 'f', 1) + "[/data]"); memo.append("[data]" + QString::number(recipe->hops.at(i).amount * 1000, 'f', 2) + "[/data]"); if (recipe->hops.at(i).useat == HOP_USEAT_BOIL || recipe->hops.at(i).useat == HOP_USEAT_WHIRLPOOL) - memo.append("[data]" + hop_use[recipe->hops.at(i).useat] + " " + QString::number(recipe->hops.at(i).time) + " minuten[/data][/row]\n"); + memo.append("[data]" + QCoreApplication::translate("HopUse", g_hop_useat[recipe->hops.at(i).useat]) + " " + QString::number(recipe->hops.at(i).time) + " minuten[/data][/row]\n"); else if (recipe->hops.at(i).useat == HOP_USEAT_DRY_HOP) - memo.append("[data]" + hop_use[recipe->hops.at(i).useat] + " " + QString::number(recipe->hops.at(i).time / 1440) + " dagen[/data][/row]\n"); + memo.append("[data]" + QCoreApplication::translate("HopUse", g_hop_useat[recipe->hops.at(i).useat]) + " " + QString::number(recipe->hops.at(i).time / 1440) + " dagen[/data][/row]\n"); else - memo.append("[data]" + hop_use[recipe->hops.at(i).useat] + "[/data][/row]\n"); + memo.append("[data]" + QCoreApplication::translate("HopUse", g_hop_useat[recipe->hops.at(i).useat]) + "[/data][/row]\n"); } memo.append("[/tabular]\n\n"); @@ -510,11 +492,11 @@ memo.append("[head]Specerij, kruid, brouwzout[/head][head]Type grondstof[/head][head]Gebruik tijdens[/head][head]Hoeveel[/head]\n"); for (int i = 0; i < recipe->miscs.size(); i++) { memo.append("[row][data]" + recipe->miscs.at(i).name + "[/data]"); - memo.append("[data]" + misc_type[recipe->miscs.at(i).type] + "[/data]"); + memo.append("[data]" + QCoreApplication::translate("MiscType", g_misc_types[recipe->miscs.at(i).type]) + "[/data]"); if (recipe->miscs.at(i).use_use == MISC_USES_BOIL) - memo.append("[data]" + misc_use[recipe->miscs.at(i).use_use] + " " + QString::number(recipe->miscs.at(i).time) + " min[/data]"); + memo.append("[data]" + QCoreApplication::translate("MiscUse", g_misc_uses[recipe->miscs.at(i).use_use]) + " " + QString::number(recipe->miscs.at(i).time) + " min[/data]"); else - memo.append("[data]" + misc_use[recipe->miscs.at(i).use_use] + "[/data]"); + memo.append("[data]" + QCoreApplication::translate("MiscUse", g_misc_uses[recipe->miscs.at(i).use_use]) + "[/data]"); memo.append("[data]"+QString::number(recipe->miscs.at(i).amount * 1000, 'f', 2)+((recipe->miscs.at(i).amount_is_weight)?" gr":" ml")+"[/data][/row]\n"); } memo.append("[/tabular]\n\n"); @@ -525,8 +507,8 @@ for (int i = 0; i < recipe->yeasts.size(); i++) { memo.append("[row][data]" + recipe->yeasts.at(i).laboratory + " " + recipe->yeasts.at(i).product_id + "[/data]"); memo.append("[data]" + recipe->yeasts.at(i).name + "[/data]"); - memo.append("[data]" + yeast_use[recipe->yeasts.at(i).use] + "[/data]"); - memo.append("[data]" + yeast_form[recipe->yeasts.at(i).form] + "[/data]"); + memo.append("[data]" + QCoreApplication::translate("YeastUse", g_yeast_use[recipe->yeasts.at(i).use]) + "[/data]"); + memo.append("[data]" + QCoreApplication::translate("YeastForm", g_yeast_forms[recipe->yeasts.at(i).form]) + "[/data]"); if (recipe->yeasts.at(i).form == YEAST_FORMS_LIQUID) memo.append("[data]" + QString::number(recipe->yeasts.at(i).amount, 'f', 0) + " pak[/data][/row]\n"); else if (recipe->yeasts.at(i).form == YEAST_FORMS_DRY || recipe->yeasts.at(i).form == YEAST_FORMS_DRIED) @@ -542,9 +524,9 @@ for (int i = 0; i < recipe->mashs.size(); i++) { memo.append("[row][data]" + recipe->mashs.at(i).step_name + "[/data]"); if (recipe->mashs.at(i).step_type != 1) - memo.append("[data]" + step_type[recipe->mashs.at(i).step_type]+" "+QString::number(recipe->mashs.at(i).step_infuse_amount, 'f', 1) + " L[/data]"); + memo.append("[data]" + QCoreApplication::translate("StepType", g_step_types[recipe->mashs.at(i).step_type])+" "+QString::number(recipe->mashs.at(i).step_infuse_amount, 'f', 1) + " L[/data]"); else - memo.append("[data]" + step_type[recipe->mashs.at(i).step_type] + "[/data]"); + memo.append("[data]" + QCoreApplication::translate("StepType", g_step_types[recipe->mashs.at(i).step_type]) + "[/data]"); memo.append("[data]" + QString::number(recipe->mashs.at(i).step_temp, 'f', 1) + " °C[/data]"); memo.append("[data]" + QString::number(recipe->mashs.at(i).step_time, 'f', 0) + " min[/data]"); memo.append("[data]" + QString::number(recipe->mashs.at(i).ramp_time, 'f', 0) + " min[/data][/row]\n");