Skip to content

Commit

Permalink
Merge pull request #417 from hasecilu/i18n/typos
Browse files Browse the repository at this point in the history
Typos
  • Loading branch information
shaise authored Dec 4, 2024
2 parents bf1bda8 + f43b72d commit 788d21d
Show file tree
Hide file tree
Showing 7 changed files with 693 additions and 267 deletions.
2 changes: 1 addition & 1 deletion Resources/panels/BaseShapeOptions.ui
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
</size>
</property>
<property name="toolTip">
<string>height of base shape</string>
<string>Height of base shape</string>
</property>
<property name="decimals">
<number>3</number>
Expand Down
2 changes: 1 addition & 1 deletion Resources/panels/ExtrudedCutoutPanel.ui
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
</item>
<item>
<property name="text">
<string>Symetric</string>
<string>Symmetric</string>
</property>
</item>
<item>
Expand Down
2 changes: 1 addition & 1 deletion Resources/panels/SolidCornerReliefPanel.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Add Cornner Relief on Solid</string>
<string>Add Corner Relief on Solid</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
Expand Down
904 changes: 651 additions & 253 deletions Resources/translations/SheetMetal.ts

Large diffs are not rendered by default.

42 changes: 34 additions & 8 deletions Resources/translations/update_translation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,37 @@ update_locale() {
fi
}

normalize_crowdin_files() {
# Rename files which locales are different on FreeCAD and delete not supported locales
crowdin_fixes=(af-ZA ar-SA be-BY bg-BG ca-ES cs-CZ da-DK de-DE el-GR eu-ES fi-FI
fil-PH fr-FR gl-ES hr-HR hu-HU it-IT ja-JP ka-GE kab-KAB ko-KR lt-LT nl-NL
no-NO pl-PL ro-RO ru-RU sk-SK sl-SI sr-SP tr-TR uk-UA vi-VN)

crowdin_deletes=(az-AZ bn-BD br-FR bs-BA en en-GB en-US eo-UY es-CO es-VE et-EE fa-IR he-IL
hi-IN hy-AM id-ID kaa lv-LV mk-MK ms-MY sat-IN si-LK ta-IN te-IN th-TH ur-PK xav yo-NG)

for pattern in "${crowdin_fixes[@]}"; do
find . -type f -name "*_${pattern}\.*" | while read -r file; do
mv -v "$file" "${file//-*./.}"
done
done

for pattern in "${crowdin_deletes[@]}"; do
find . -type f -name "*_${pattern}\.*" -delete
done
}

help() {
echo -e "\nDescription:"
echo -e "\tCreate, update and release translation files."
echo -e "\nUsage:"
echo -e "\t./update_translation.sh [-R] [-U] [-r <locale>] [-u <locale>]"
echo -e "\nFlags:"
echo -e " -R\n\tRelease all locales"
echo -e " -U\n\tUpdate main translation file (locale agnostic)"
echo -e " -R\n\tRelease all translations (qm files)"
echo -e " -U\n\tUpdate all translations (ts files)"
echo -e " -r <locale>\n\tRelease the specified locale"
echo -e " -u <locale>\n\tUpdate strings for the specified locale"
echo -e " -N\n\tNormalize CrowdIn filenames"
}

# Main function ------------------------------------------------------------------------------------
Expand All @@ -99,19 +120,24 @@ LRELEASE=/usr/lib/qt6/bin/lrelease # from Qt6
# LRELEASE=lrelease # from Qt5
WB="SheetMetal"

# Enforce underscore on locales
sed -i '3s/-/_/' ${WB}*.ts
sed -i '3s/-/_/' ${WB}*.ts # Enforce underscore on locales
sed -i '3s/\"en\"/\"en_US\"/g' ${WB}*.ts # Use en_US

if [ $# -eq 1 ]; then
if [ "$1" == "-R" ]; then
find . -type f -name '*_*.ts' | while IFS= read -r file; do
# Release all locales
$LRELEASE "$file"
$LRELEASE -nounfinished "$file"
echo
done
elif [ "$1" == "-U" ]; then
# Update main file (agnostic)
update_locale
for locale in "${supported_locales[@]}"; do
update_locale "$locale"
done
elif [ "$1" == "-u" ]; then
update_locale # Update main file (agnostic)
elif [ "$1" == "-N" ]; then
normalize_crowdin_files
else
help
fi
Expand All @@ -120,7 +146,7 @@ elif [ $# -eq 2 ]; then
if is_locale_supported "$LOCALE"; then
if [ "$1" == "-r" ]; then
# Release locale (creation of *.qm file from *.ts file)
$LRELEASE "${WB}_${LOCALE,,}.ts"
$LRELEASE -nounfinished "${WB}_${LOCALE,,}.ts"
elif [ "$1" == "-u" ]; then
# Update main & locale files
update_locale
Expand Down
4 changes: 2 additions & 2 deletions SheetMetalBaseCmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def __init__(self, obj, sketch):
obj.addProperty(
"App::PropertyLength", "thickness", "Parameters", _tip_
).thickness = 1.0
_tip_ = translate("App::Property", "Relief Type")
_tip_ = translate("App::Property", "Bend Plane")
obj.addProperty(
"App::PropertyEnumeration", "BendSide", "Parameters", _tip_
).BendSide = ["Outside", "Inside", "Middle"]
Expand Down Expand Up @@ -244,7 +244,7 @@ def GetResources(self):
"ToolTip": translate(
"SheetMetal",
"Create a sheetmetal wall from a sketch\n"
"1. Select a Skech to create bends with walls.\n"
"1. Select a Sketch to create bends with walls.\n"
"2. Use Property editor to modify other parameters",
),
}
Expand Down
4 changes: 3 additions & 1 deletion SheetMetalFormingCmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ def __init__(self, obj, selobj, selobj_items, seltool, seltool_items):
obj.addProperty("App::PropertyLinkSub", "toolObject", "Parameters",
_tip_).toolObject = (seltool, seltool_items)
_tip_ = FreeCAD.Qt.translate(
"App::Property", "Point Sketch on Sheetmetal")
"App::Property",
"Sketch containing circle's points to multiply and pattern the embossed feature",
)
obj.addProperty("App::PropertyLink", "Sketch", "Parameters1", _tip_)
obj.Proxy = self

Expand Down

0 comments on commit 788d21d

Please sign in to comment.