Skip to content

Commit

Permalink
Added translation if authentication confirmation code is wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
jbtronics committed Oct 13, 2024
1 parent ca116ca commit ccf67c0
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/Controller/UserSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public function userSettings(Request $request, EntityManagerInterface $em, UserP
$google_form->get('googleAuthenticatorSecret')->setData($user->getGoogleAuthenticatorSecret());
}
$google_form->handleRequest($request);

if (!$this->demo_mode && !$user->isSamlUser() && $google_form->isSubmitted() && $google_form->isValid()) {
if (!$google_enabled) {
//Save 2FA settings (save secrets)
Expand Down
80 changes: 43 additions & 37 deletions translations/validators.en.xlf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="en">
<file id="validators.en">
<unit id="xevSdCK" name="part.master_attachment.must_be_picture">
<unit id="cRbk.cm" name="part.master_attachment.must_be_picture">
<notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentContainingDBElement.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note>
Expand Down Expand Up @@ -42,7 +42,7 @@
<target>The preview attachment must be a valid picture!</target>
</segment>
</unit>
<unit id="VJHTkxx" name="structural.entity.unique_name">
<unit id="v8HkcJB" name="structural.entity.unique_name">
<notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Base\AbstractCompany.php:0</note>
Expand Down Expand Up @@ -87,7 +87,7 @@
<target>An element with this name already exists on this level!</target>
</segment>
</unit>
<unit id="3ODUtpU" name="parameters.validator.min_lesser_typical">
<unit id="dW7b2B_" name="parameters.validator.min_lesser_typical">
<notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parameters\AbstractParameter.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parameters\AttachmentTypeParameter.php:0</note>
Expand All @@ -107,7 +107,7 @@
<target>Value must be lesser or equal the the typical value ({{ compared_value }}).</target>
</segment>
</unit>
<unit id="jDBA_WW" name="parameters.validator.min_lesser_max">
<unit id="Yfp2uC5" name="parameters.validator.min_lesser_max">
<notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parameters\AbstractParameter.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parameters\AttachmentTypeParameter.php:0</note>
Expand All @@ -127,7 +127,7 @@
<target>Value must be lesser than the maximum value ({{ compared_value }}).</target>
</segment>
</unit>
<unit id="ygK_e_X" name="parameters.validator.max_greater_typical">
<unit id="P6b.8Ou" name="parameters.validator.max_greater_typical">
<notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parameters\AbstractParameter.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parameters\AttachmentTypeParameter.php:0</note>
Expand All @@ -147,7 +147,7 @@
<target>Value must be greater or equal than the typical value ({{ compared_value }}).</target>
</segment>
</unit>
<unit id="isXL.ie" name="validator.user.username_already_used">
<unit id="P41193Y" name="validator.user.username_already_used">
<notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
<note priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
Expand All @@ -157,7 +157,7 @@
<target>A user with this name is already exisiting</target>
</segment>
</unit>
<unit id="NcM463r" name="user.invalid_username">
<unit id="EKPQiyf" name="user.invalid_username">
<notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
<note priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
Expand All @@ -167,7 +167,7 @@
<target>The username must contain only letters, numbers, underscores, dots, pluses or minuses!</target>
</segment>
</unit>
<unit id="lZvhKYu" name="validator.noneofitschild.self">
<unit id="_v.DMg." name="validator.noneofitschild.self">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
Expand All @@ -176,7 +176,7 @@
<target>An element can not be its own parent!</target>
</segment>
</unit>
<unit id="pr07aV4" name="validator.noneofitschild.children">
<unit id="W90LyFQ" name="validator.noneofitschild.children">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
Expand All @@ -185,173 +185,179 @@
<target>You can not assign children element as parent (This would cause loops)!</target>
</segment>
</unit>
<unit id="ayNr6QK" name="validator.select_valid_category">
<unit id="GAUS.LK" name="validator.select_valid_category">
<segment state="translated">
<source>validator.select_valid_category</source>
<target>Please select a valid category!</target>
</segment>
</unit>
<unit id="6vIlN5q" name="validator.part_lot.only_existing">
<unit id="h6qELde" name="validator.part_lot.only_existing">
<segment state="translated">
<source>validator.part_lot.only_existing</source>
<target>Can not add new parts to this location as it is marked as "Only Existing"</target>
</segment>
</unit>
<unit id="3xoKOIS" name="validator.part_lot.location_full.no_increase">
<unit id="Prriyy0" name="validator.part_lot.location_full.no_increase">
<segment state="translated">
<source>validator.part_lot.location_full.no_increase</source>
<target>Location is full. Amount can not be increased (new value must be smaller than {{ old_amount }}).</target>
</segment>
</unit>
<unit id="R6Ov4Yt" name="validator.part_lot.location_full">
<unit id="eeEjB4s" name="validator.part_lot.location_full">
<segment state="translated">
<source>validator.part_lot.location_full</source>
<target>Location is full. Can not add new parts to it.</target>
</segment>
</unit>
<unit id="BNQk2e7" name="validator.part_lot.single_part">
<unit id="2yWi8eP" name="validator.part_lot.single_part">
<segment state="translated">
<source>validator.part_lot.single_part</source>
<target>This location can only contain a single part and it is already full!</target>
</segment>
</unit>
<unit id="4gPskOG" name="validator.attachment.must_not_be_null">
<unit id="A.TFhbb" name="validator.attachment.must_not_be_null">
<segment state="translated">
<source>validator.attachment.must_not_be_null</source>
<target>You must select an attachment type!</target>
</segment>
</unit>
<unit id="cDDVrWT" name="validator.orderdetail.supplier_must_not_be_null">
<unit id=".lqKoij" name="validator.orderdetail.supplier_must_not_be_null">
<segment state="translated">
<source>validator.orderdetail.supplier_must_not_be_null</source>
<target>You must select an supplier!</target>
</segment>
</unit>
<unit id="k5DDdB4" name="validator.measurement_unit.use_si_prefix_needs_unit">
<unit id="bcNZzK." name="validator.measurement_unit.use_si_prefix_needs_unit">
<segment state="translated">
<source>validator.measurement_unit.use_si_prefix_needs_unit</source>
<target>To enable SI prefixes, you have to set a unit symbol!</target>
</segment>
</unit>
<unit id="DuzIOCr" name="part.ipn.must_be_unique">
<unit id="gZ5FFL1" name="part.ipn.must_be_unique">
<segment state="translated">
<source>part.ipn.must_be_unique</source>
<target>The internal part number must be unique. {{ value }} is already in use!</target>
</segment>
</unit>
<unit id="Z4Kuuo2" name="validator.project.bom_entry.name_or_part_needed">
<unit id="P31Yg.d" name="validator.project.bom_entry.name_or_part_needed">
<segment state="translated">
<source>validator.project.bom_entry.name_or_part_needed</source>
<target>You have to choose a part for a part BOM entry or set a name for a non-part BOM entry.</target>
</segment>
</unit>
<unit id="WF_v4ih" name="project.bom_entry.name_already_in_bom">
<unit id="5CEup_N" name="project.bom_entry.name_already_in_bom">
<segment state="translated">
<source>project.bom_entry.name_already_in_bom</source>
<target>There is already an BOM entry with this name!</target>
</segment>
</unit>
<unit id="5v4p85H" name="project.bom_entry.part_already_in_bom">
<unit id="jB3B50E" name="project.bom_entry.part_already_in_bom">
<segment state="translated">
<source>project.bom_entry.part_already_in_bom</source>
<target>This part already exists in the BOM!</target>
</segment>
</unit>
<unit id="3lM32Tw" name="project.bom_entry.mountnames_quantity_mismatch">
<unit id="NdkzP1n" name="project.bom_entry.mountnames_quantity_mismatch">
<segment state="translated">
<source>project.bom_entry.mountnames_quantity_mismatch</source>
<target>The number of mountnames has to match the BOMs quantity!</target>
</segment>
</unit>
<unit id="x47D5WT" name="project.bom_entry.can_not_add_own_builds_part">
<unit id="8teRCgR" name="project.bom_entry.can_not_add_own_builds_part">
<segment state="translated">
<source>project.bom_entry.can_not_add_own_builds_part</source>
<target>You can not add a project's own builds part to the BOM.</target>
</segment>
</unit>
<unit id="2x2XDI_" name="project.bom_has_to_include_all_subelement_parts">
<unit id="asBxPxe" name="project.bom_has_to_include_all_subelement_parts">
<segment state="translated">
<source>project.bom_has_to_include_all_subelement_parts</source>
<target>The project BOM has to include all subprojects builds parts. Part %part_name% of project %project_name% missing!</target>
</segment>
</unit>
<unit id="U9b1EzD" name="project.bom_entry.price_not_allowed_on_parts">
<unit id="uxaE9Ct" name="project.bom_entry.price_not_allowed_on_parts">
<segment state="translated">
<source>project.bom_entry.price_not_allowed_on_parts</source>
<target>Prices are not allowed on BOM entries associated with a part. Define the price on the part instead.</target>
</segment>
</unit>
<unit id="ID056SR" name="validator.project_build.lot_bigger_than_needed">
<unit id="xZ68Nzl" name="validator.project_build.lot_bigger_than_needed">
<segment state="translated">
<source>validator.project_build.lot_bigger_than_needed</source>
<target>You have selected more quantity to withdraw than needed! Remove unnecessary quantity.</target>
</segment>
</unit>
<unit id="6hV5UqD" name="validator.project_build.lot_smaller_than_needed">
<unit id="68_.V_X" name="validator.project_build.lot_smaller_than_needed">
<segment state="translated">
<source>validator.project_build.lot_smaller_than_needed</source>
<target>You have selected less quantity to withdraw than needed for the build! Add additional quantity.</target>
</segment>
</unit>
<unit id="G9ZKt.4" name="part.name.must_match_category_regex">
<unit id="yZGS8uZ" name="part.name.must_match_category_regex">
<segment state="translated">
<source>part.name.must_match_category_regex</source>
<target>The part name does not match the regular expression stated by the category: %regex%</target>
</segment>
</unit>
<unit id="m8kMFhf" name="validator.attachment.name_not_blank">
<unit id="Q8wP5Jd" name="validator.attachment.name_not_blank">
<segment state="translated">
<source>validator.attachment.name_not_blank</source>
<target>Set a value here, or upload a file to automatically use its filename as name for the attachment.</target>
</segment>
</unit>
<unit id="nwGaNBW" name="validator.part_lot.owner_must_match_storage_location_owner">
<unit id="DH0IkNR" name="validator.part_lot.owner_must_match_storage_location_owner">
<segment state="translated">
<source>validator.part_lot.owner_must_match_storage_location_owner</source>
<target>The owner of this lot must match the owner of the selected storage location (%owner_name%)!</target>
</segment>
</unit>
<unit id="HXSz3nQ" name="validator.part_lot.owner_must_not_be_anonymous">
<unit id="TzySicw" name="validator.part_lot.owner_must_not_be_anonymous">
<segment state="translated">
<source>validator.part_lot.owner_must_not_be_anonymous</source>
<target>A lot owner must not be the anonymous user!</target>
</segment>
</unit>
<unit id="N8aA0Uh" name="validator.part_association.must_set_an_value_if_type_is_other">
<unit id="GthNWUb" name="validator.part_association.must_set_an_value_if_type_is_other">
<segment state="translated">
<source>validator.part_association.must_set_an_value_if_type_is_other</source>
<target>If you set the type to "other", then you have to set a descriptive value for it!</target>
</segment>
</unit>
<unit id="9VYNZ4v" name="validator.part_association.part_cannot_be_associated_with_itself">
<unit id="Be4Im81" name="validator.part_association.part_cannot_be_associated_with_itself">
<segment state="translated">
<source>validator.part_association.part_cannot_be_associated_with_itself</source>
<target>A part can not be associated with itself!</target>
</segment>
</unit>
<unit id="csc1PNn" name="validator.part_association.already_exists">
<unit id="q5Ej6Xm" name="validator.part_association.already_exists">
<segment state="translated">
<source>validator.part_association.already_exists</source>
<target>The association with this part already exists!</target>
</segment>
</unit>
<unit id="sfW4NYE" name="validator.part_lot.vendor_barcode_must_be_unique">
<unit id="HbI5bga" name="validator.part_lot.vendor_barcode_must_be_unique">
<segment state="translated">
<source>validator.part_lot.vendor_barcode_must_be_unique</source>
<target>This vendor barcode value was already used in another lot. The barcode must be unique!</target>
</segment>
</unit>
<unit id="o1qmPUm" name="validator.year_2038_bug_on_32bit">
<unit id="ufQJh7E" name="validator.year_2038_bug_on_32bit">
<segment state="translated">
<source>validator.year_2038_bug_on_32bit</source>
<target>Due to technical limitations, it is not possible to select dates after the 2038-01-19 on 32-bit systems!</target>
</segment>
</unit>
<unit id="iXcU7ce" name="validator.invalid_range">
<unit id="ZFxQ0BZ" name="validator.invalid_range">
<segment state="translated">
<source>validator.invalid_range</source>
<target>The given range is not valid!</target>
</segment>
</unit>
<unit id="m4gp2P_" name="validator.google_code.wrong_code">
<segment>
<source>validator.google_code.wrong_code</source>
<target>Invalid code. Check that your authenticator app is set up correctly and that both the server and authentication device has the time set correctly.</target>
</segment>
</unit>
</file>
</xliff>

0 comments on commit ccf67c0

Please sign in to comment.