Commit Graph

85 Commits

Author SHA1 Message Date
3d-gussner
4b384f3694 Remove gawk 2022-10-03 16:41:03 +02:00
3d-gussner
b62d36face Update PF-build.sh to use Arduino_boards 1.6.0 which is same as devel 1.0.5-2 2022-10-03 16:31:37 +02:00
3d-gussner
6c6f6abfc0 Rename EN_ONLY to EN_FARM
remove DEBUG/DEVEL/ALPHA/BETA lcd warning

Fix cherry-pick issues
2022-09-29 17:47:05 +02:00
3d-gussner
3a77ef3ce7 Sync PF-build.sh and MK404-build.sh with MK3_3.11.1 branch 2022-07-12 08:48:22 +02:00
Yuri D'Elia
e37435b53f Merge remote-tracking branch 'upstream/MK3_3.11.1' into mk311_sync 2022-07-04 16:14:23 +02:00
3d-gussner
d4d5294964 Revert "Fix Mk2.5/S zip after change PO-based language translation support"
This reverts commit 7162b224a7.

Revert direct push to prusa3d MK3_3.11.1
2022-07-01 08:29:52 +02:00
3d-gussner
7162b224a7 Fix Mk2.5/S zip after change PO-based language translation support
Limit atmegaMK404 boards mem to 8,16,32
2022-07-01 08:26:56 +02:00
3d-gussner
0af88574fb Update to Arduino_boards version 1.0.5-1 2022-06-20 17:04:58 +02:00
3d-gussner
81a8418dd6 C++17 Arduino_boards version 1.0.5-1 2022-06-20 17:02:30 +02:00
3d-gussner
881e2964e0 Update to Arduino_boards version 1.0.5-1 2022-06-20 11:16:11 +02:00
Yuri D'Elia
0d7680dbf7
New PO-based language translation support (#3471)
* lang: Add a PO language extractor with FW metadata support

Implement a straight-to-po language extractor which supports our custom
language requirements:

- _i/_I/ISTR for text string definitions
- _T for catalog translations (with back-reference support)
- //// EOL comments with:
  - MSG_ catalog entry name identifiers
  - c=X r=Y annotations for screen dimensioning checks
- Crude support for commented lines

All source locations are correctly referenced in the PO, with the
metadata colleted in the comment for further processing.

Several checks are implemented already during extraction:

- Correct catalog name assignment (no duplicates)
- Metadata checks for each entry

Further checks will be implemented by directly checking the translated PO file.

Requires "polib" and "regex" python modules.

* lang: Adapt lang-check to work directly on PO/POT files

* lang: Allow lang-extract to generate stable (pre-sorted) output directly

* lang: Further extend lang-extract consistency/error checking

- Do not parse inside preprocessor conditionals
- Distinguish between references and definitions
- Warn about missing references and definitions

* lang: lang-extract: warn about incorrect PROGMEM assignments

Check that ISTR is used along with PROGMEM_I1 in an attempt to spot
useless translated catalogs.

* lang: lang-extract: Improved handling of same-line translations

Correctly reference metadata on same-line translations.

* lang: lang-extract: Handle _O as a cat-ref

https://github.com/prusa3d/Prusa-Firmware/pull/3434

* lang: lang-extract: Warn about unused catalog definitions

* lang: lang-extract: Allow propagating translation comments via //

The definition:

    code //// definition [// comment]

will check [definition] as before, but blindly accumulate // comment.
The comment is then re-appended back into the PO files for translators
with the form:

    definition
    comment
    comment...

* lang: Fix incorrect display definitions

* lang: lang-extract: Check source encoding/charmap

* lang: Translate the degree symbol

* lang: Unbreak/cleanup DEBUG_SEC_LANG

* lang: Improve meaning of comment

* lang: Split charset conversions into an aux lib for future use

* lang: Implement lang-map.py to extract the translation symbol map

- Extracts the translatable symbol map for further use
- Computes a stable "language signature" from the map itself
- Optionally patches the binary update the symbols

* lang: Check for translation recoding problems

* lang: Implement a transliteration map to post-process translations

TRANS_CHARS is now used to replace unavailable symbols to the source
encoding, only while producing the language catalog.

* lang: Handle/check character replacements in lang-check

Filter the translation through TRANS_CHARS, so that the preview and
length check are performed correctly for expanding replacements such as
'ß' to 'ss'.

* lang: Implement lang-build.py to generate the final language catalog

* Cleanup .gitignore

* lang: Drop txt language files

* lang: Remove outdated translation scripts and obsolete docs

* lang: Update build scripts for new infrastructure

* lang: [no] Integrate accents from po/new/no.po

We now support accents natively

* lang: Remove redundant directory po/new/

* lang: Fix encoding of LCD characters in PO files

* lang: [hr] Fix wrapping in MSG_CRASH_DET_ONLY_IN_NORMAL

* lang: Sort and reformat PO files for further massaging

* lang: Switch to developer (dot) comments for PO metadata

* lang: Allow the IGNORE annotation to skip extraction

* lang: Fix missing/broken language metadata in sources

* lang: Add update-pot.sh and regenerate po/Firmware.pot

* lang: Add update-po.sh and refresh all PO files

* lang: Add summary documentation about the new translation workflow

* Add more ignored files

* CI: Add new required dependencies to travis

* lang: lang-build: Improve warning message

"referenced" was really meaning that data is being duplicated.

* lang: Respect the language order as defined in config.sh

This correctly splits normal and community-made entries during language
selection.

* lang: More typos in the documentation

* lang: Check for the maximum size of each language

Each table needs to fit within LANG_SIZE_RESERVED

* lang: Properly align _SEC_LANG to page boundaries

... instead of relying on _SEC_LANG_TABLE to calculate the offset

* lang: Build support for dual-language hex files

Detect the printer type by checking the current variant type.

On printers with no xflash (MK2*), generate one hex file for each
additional language file by patching the built-in secondary language
table during the build process

* lang: Mention lang-patchsec.py

* lang: Use color() instead of tput for clarity

* lang: Allow disabling terminal colors with NO_COLOR/TERM=dumb

* lang: Consistent use of redirection in config.sh

* lang: Stricter variant-type check for xflash support

* lang: Output size stats when building double-language hex files

* lang: Respect NO_COLOR in lang-check.py

* lang: Check for repeated/incorrect annotations

Catch errors such as "c=1 c=2"

* lang: Correct MSG_SLIGHT_SKEW/MSG_SEVERE_SKEW annotations

* lang: [it] Improve MSG_*_SKEW translation

* lang: Use INTLHEX instead of OUTHEX_P/S for configuration

We already have OUTHEX which is the compiled firmware.

Use INTLHEX for the final internationalized firmware, which is less
confusing. Also, assume it being a prefix for all generated hex
files, which reduces the number of variables set.

* lang: Move lang_map to lib.io for further use

* lang: lang-check: Accept a firmware map file to suppress unused string warnings

* lang: Use the map file to reduce useless warnings during fw-build

* lang: lang-check: Also suppress unused empty annotations

* lang: Fix MSG_MOVE_CARRIAGE_TO_THE_TOP_Z annotation

Refresh pot file

* lang: lang-check: Do not warn about same-word translations by default

Do not warn when one-word translations such as "No" result in "No" also
in other languages, since this is common in latin languages.

Allow to re-enable the warning with --warn-same

* lang: lang-build: Handle same-source/translation efficiently

* lang: [it] Explicitly add On/Off/Reset/Wizard to suppress warnings

Instead of displaying a warning, supress the warning and explicitly
translate each entry using english (which is the common/acceptable
word in these cases).

* lang: [it] Suppress more warnings

* lang: lang-check: Add intermediate "suggest" warning category

Warnings in the "suggest" category as shown as [S] as based on pure
speculation from the checking tool, such as the translation being
significantly shorter than the original.

As a result, they can be suppressed with --no-suggest

* lang: Return translation status from lang-check

- 0 if the translation only contains suggestions
- 1 if the translation contains warnings or errors

Check for the exit status in fw-build.sh, but do nothing at the moment
except printing a non-fatal error.

* lang: Remove "trim_trailing_whitespace=false" for po files

PO files got cleaned up/rewritten. We can now ensure they stay
consistent.

* lang: [sv] Re-integrate changes from 70c73cb

* lang: [no] Reintegrate changes from @pkg2000
2022-06-16 15:03:30 +02:00
3d-gussner
dc66a773f1 C++17 Arduino_boards version 1.0.5-1 2022-05-19 09:24:21 +02:00
3d-gussner
3f3915304e Limit atmegaMK404 boards mem to 8,16,32 2022-02-24 11:42:23 +01:00
3d-gussner
98fa74a0d7 Change to Arduino IDE 1.8.19 and Arduino boards 1.0.5
Fix DEV_STATUS to set correctly on RC/BETA/ALPHA/DEVEL
Fix atmegaMK404 Board mem and flash modifications
2022-02-24 10:44:37 +01:00
Alex Voinea
7c9369ede6 PF-build.sh fix delay for the "Restoring" after failure when using "-o0"
Also update PF-build.sh revision
2022-02-13 09:52:04 +01:00
3d-gussner
35cee44df1 Add SRCDIR for compatibility with build server 2022-02-10 08:27:04 +01:00
3d-gussner
db7b41e294 Add community language firmware files for MK2.5/S
Add selection of language in MK404 for MK2.5/S
2022-02-09 09:41:11 +01:00
3d-gussner
256c3f453b PF-build.sh:
- Add sort of variants. Request from @leptun
- Add Arduino IDE 1.8.19 as an option
- Allow upper and lower case. Request from @TojikCZ

MK404-build.sh:
- Allow upper and lower case. Request by @TojikCZ
- Add update option to release OR devel
2022-02-02 17:23:31 +01:00
3d-gussner
a795fda7b5 Trying to push travis build 2022-01-21 07:40:04 +01:00
3d-gussner
6dd7681f6b Cleanup outdated code 2022-01-03 12:19:58 +01:00
3d-gussner
7fea716391 Disable use of lang-community script 2022-01-03 11:25:15 +01:00
3d-gussner
da910fe861 Switch to arduino_boards v1.0.4 2021-08-02 08:34:35 +02:00
3d-gussner
e779803261 Add/fix few functions
Check MK404 for latest stable release instead of dev branch
2021-07-29 10:57:05 +02:00
3d-gussner
ffb7412637 Fix fresh build 2021-07-17 19:06:58 +02:00
3d-gussner
9fd9ce34a9 MK404 is only supported on Linux at this moment. 2021-06-24 07:29:54 +02:00
3d-gussner
17d7fdf333 Fix MK404 user interaction not to show if compiling 'All' variants 2021-06-24 05:50:20 +02:00
3d-gussner
9f9203b280 Change atmega404 board flash argument to y
Use newer version of MK404-build.sh instead start the program
Added _RAM-<value> and _FLASH-<value> as OUTPUT_FILE_SUFFIX if someone builds an atmega404 firmware
Added some logic if IDE 1.8.13 is used
Added some logic if Arduino_boards 1.0.4 is used
Fixed typo
Restore original `Configuration.h` and `config.h` in case of cannceled script or failed compiling during next start of this script.
use function
Improve MK404 usage
2021-06-23 20:14:30 +02:00
3d-gussner
2b29e52d53 Defined OUTPUT_FILENAME in one location
Added _RAM-<value> and _FLASH-<value> as OUTPUT_FILE_SUFFIX if someone builds an atmega404 firmware
Added some logic if IDE 1.8.13 is used
Added some logic if Arduino_boards 1.0.4 is used
Fixed typo
2021-06-22 09:20:48 +02:00
3d-gussner
7a67d578fd Pf-build.sh
Change atmega404 board flash argument to y
Use newer version of MK404-build.sh instead start the program

MK404-build.sh
Change board_flash argument to 'y' and firmware_version to 'f
2021-06-21 09:16:19 +02:00
3d-gussner
b12c0e2326 Use atmega404 if extanded RAM or FLASH size are chosen
Remove MK404 copy of lang file as it has been fixed in MK404
2021-06-18 13:46:25 +02:00
3d-gussner
ae41d6ca40 Change version to v2.0.0 2021-06-17 21:02:46 +02:00
3d-gussner
4614400298 Save ELF files for FW3.10.1 debugging PRs
Add verbose_IDE to output more information during build
2021-06-17 20:59:35 +02:00
3d-gussner
56889bae13 Update PF-build.sh to work after @DRracer Remove FW version parsing PR 2021-06-17 19:08:55 +02:00
3d-gussner
e765c300b0 Update MK404 part to '--bootloader-file ""'
Some cosmetics
2021-05-05 20:05:35 +02:00
3d-gussner
31b38393e9 Merge branch 'MK3_more_flash_more_ram' into MK3_MK404
Add atmega404
2021-05-03 20:01:48 +02:00
3d-gussner
a5ba31b247 Indentations 2021-05-03 14:14:47 +02:00
3d-gussner
16359780f9 Add MK404 'atmega404' and 'atmega404_no_bootloder' option 2021-05-03 14:11:03 +02:00
3d-gussner
41d7eaa94b Update documentation 2021-05-03 08:24:02 +02:00
3d-gussner
d8dd8e49e5 Comment out "manual" xflash update as MK404 can do it now
directly from the hex file.
2021-05-03 07:00:15 +02:00
3d-gussner
2195116beb Add EN_ONLY support for MK404 2021-05-01 01:30:03 +02:00
3d-gussner
6ba8999607 Indentations 2021-04-29 19:23:52 +02:00
3d-gussner
2ad0514d7c Save changes 2021-04-29 19:15:32 +02:00
3d-gussner
1a5898c673 Improve MK404-build.sh check, update 2021-04-23 20:09:20 +02:00
3d-gussner
f8bec339e2 Hack to get more flash and ram for MK404 debug 2021-04-18 20:28:08 +02:00
3d-gussner
0f771b1218 Merge remote-tracking branch 'upstream/MK3' into MK3_MK404
Fix merge
2021-03-17 18:33:54 +01:00
3d-gussner
6ebdb004ab Add lang-community.sh script
Fix `Dutch` hex file copied in `PF-build.sh` for MK2.5/S
2021-03-01 08:25:33 +01:00
3d-gussner
1550e707be Fix few issues
Create MMU2 SDcards
MMU2 only for MK3/S
2021-02-15 11:41:41 +01:00
3d-gussner
bf33198866 Add copy of MK3 and MK3S lang.bin files to MK404 *_xflash.bin
Minor changes:
- Indentations
- Documentation
2021-02-15 11:41:41 +01:00
3d-gussner
de337476cd Add MK404 support
Indentations
2021-02-15 11:41:41 +01:00
3d-gussner
fba83bd309 Add new flags -c -p -n 2021-01-28 09:48:05 +01:00