From 1a0f8807287c6aae06c9ab8aed4b1625f789af8d Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 23 Jul 2021 11:15:41 -0700 Subject: [PATCH 1/2] Bring Go code formatting into compliance --- legacy/builder/wipeout_build_path_if_build_options_changed.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/legacy/builder/wipeout_build_path_if_build_options_changed.go b/legacy/builder/wipeout_build_path_if_build_options_changed.go index fbb621626ea..9ba8d17b606 100644 --- a/legacy/builder/wipeout_build_path_if_build_options_changed.go +++ b/legacy/builder/wipeout_build_path_if_build_options_changed.go @@ -41,12 +41,12 @@ func (s *WipeoutBuildPathIfBuildOptionsChanged) Run(ctx *types.Context) error { var opts *properties.Map if err := json.Unmarshal([]byte(buildOptionsJson), &opts); err != nil || opts == nil { - panic(constants.BUILD_OPTIONS_FILE + " is invalid") + panic(constants.BUILD_OPTIONS_FILE + " is invalid") } var prevOpts *properties.Map if err := json.Unmarshal([]byte(previousBuildOptionsJson), &prevOpts); err != nil || prevOpts == nil { - ctx.GetLogger().Println(constants.LOG_LEVEL_DEBUG, constants.MSG_BUILD_OPTIONS_INVALID + constants.MSG_REBUILD_ALL, constants.BUILD_OPTIONS_FILE) + ctx.GetLogger().Println(constants.LOG_LEVEL_DEBUG, constants.MSG_BUILD_OPTIONS_INVALID+constants.MSG_REBUILD_ALL, constants.BUILD_OPTIONS_FILE) return doCleanup(ctx.BuildPath) } From a9a6455be80f59381fd5f134531294c1ce5657c8 Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 23 Jul 2021 11:19:11 -0700 Subject: [PATCH 2/2] Expand i18n coverage to all relevant strings This provides internationalization of the strings of the Arduino CLI code base. It will now be possible to completely translate the primary Arduino CLI user interface. We decided that the log messages would be excluded from the internationalization scope for now. The reason is that the addition of these strings would significantly increase the workload on the community translators, while generally being of less visibility and/or importance to the users. Even though on an individual basis there are surely specific log messages of higher importance than specific non-log strings that were internationalized, the log/non-log dichotomy provided an objective criterion for determining which strings were in scope for this initial effort. Perhaps we will expand the i18n coverage at some time in the future after there has been good progress on the initial translation effort. Some techniques were employed to facilitate translation: - Code references were moved out of strings in cases where a translator might mistake them for prose and translate them. - Indices were added to printf verbs when multiple were present in a string. This allows the translator to easily insert them at the appropriate location in the sentence structure without being required to understand the Go printf syntax and without being restricted to their relative order in the English language source string. Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com> --- arduino/builder/compilation_database.go | 6 +- arduino/builder/sketch.go | 26 +- arduino/cores/board.go | 8 +- arduino/cores/cores.go | 3 + arduino/cores/fqbn.go | 6 +- arduino/cores/packageindex/index.go | 5 +- arduino/cores/packagemanager/download.go | 14 +- .../cores/packagemanager/install_uninstall.go | 20 +- arduino/cores/packagemanager/loader.go | 52 +- .../cores/packagemanager/package_manager.go | 34 +- arduino/cores/status.go | 22 +- arduino/discovery/discovery.go | 35 +- arduino/libraries/libraries.go | 7 +- arduino/libraries/libraries_layout.go | 4 +- arduino/libraries/libraries_location.go | 4 +- arduino/libraries/librariesindex/json.go | 7 +- arduino/libraries/librariesmanager/install.go | 32 +- .../librariesmanager/librariesmanager.go | 13 +- arduino/libraries/librariesresolver/cpp.go | 5 +- arduino/libraries/loader.go | 6 +- arduino/monitors/serial.go | 5 +- arduino/resources/checksums.go | 35 +- arduino/resources/helpers.go | 8 +- arduino/resources/install.go | 24 +- arduino/security/signatures.go | 9 +- arduino/serialutils/serialutils.go | 12 +- arduino/sketch/sketch.go | 23 +- cli/board/attach.go | 13 +- cli/board/board.go | 8 +- cli/board/details.go | 8 +- cli/board/list.go | 26 +- cli/board/listall.go | 18 +- cli/board/search.go | 18 +- cli/burnbootloader/burnbootloader.go | 20 +- cli/cache/cache.go | 9 +- cli/cache/clean.go | 6 +- cli/cli.go | 28 +- cli/compile/compile.go | 67 +- cli/completion/completion.go | 10 +- cli/config/add.go | 8 +- cli/config/config.go | 5 +- cli/config/delete.go | 8 +- cli/config/dump.go | 6 +- cli/config/init.go | 27 +- cli/config/remove.go | 8 +- cli/config/set.go | 10 +- cli/config/validate.go | 2 +- cli/core/core.go | 7 +- cli/core/download.go | 15 +- cli/core/install.go | 21 +- cli/core/list.go | 14 +- cli/core/search.go | 22 +- cli/core/uninstall.go | 13 +- cli/core/update_index.go | 10 +- cli/core/upgrade.go | 23 +- cli/daemon/daemon.go | 19 +- cli/debug/debug.go | 42 +- cli/feedback/feedback.go | 5 +- cli/generatedocs/generatedocs.go | 14 +- cli/globals/args.go | 12 +- cli/globals/globals.go | 2 + cli/instance/instance.go | 7 +- cli/lib/args.go | 4 +- cli/lib/check_deps.go | 20 +- cli/lib/download.go | 15 +- cli/lib/examples.go | 14 +- cli/lib/install.go | 30 +- cli/lib/lib.go | 7 +- cli/lib/list.go | 28 +- cli/lib/search.go | 46 +- cli/lib/uninstall.go | 11 +- cli/lib/update_index.go | 10 +- cli/lib/upgrade.go | 10 +- cli/outdated/outdated.go | 15 +- cli/output/rpc_progress.go | 12 +- cli/sketch/archive.go | 13 +- cli/sketch/new.go | 12 +- cli/sketch/sketch.go | 7 +- cli/update/update.go | 23 +- cli/upgrade/upgrade.go | 9 +- cli/upload/upload.go | 31 +- cli/version/version.go | 7 +- commands/board/attach.go | 19 +- commands/board/details.go | 6 +- commands/board/list.go | 22 +- commands/board/listall.go | 2 +- commands/board/search.go | 2 +- commands/bundled_tools.go | 8 +- commands/bundled_tools_ctags.go | 3 + commands/bundled_tools_serial_discovery.go | 16 +- commands/compile/compile.go | 33 +- commands/core/download.go | 13 +- commands/core/install.go | 32 +- commands/core/list.go | 4 +- commands/core/search.go | 2 +- commands/core/uninstall.go | 16 +- commands/core/upgrade.go | 12 +- commands/daemon/daemon.go | 5 +- commands/daemon/debug.go | 2 +- commands/daemon/monitor.go | 4 +- commands/daemon/settings.go | 2 +- commands/debug/debug.go | 11 +- commands/debug/debug_info.go | 18 +- commands/instances.go | 130 +- commands/lib/download.go | 7 +- commands/lib/install.go | 24 +- commands/lib/list.go | 10 +- commands/lib/resolve_deps.go | 6 +- commands/lib/search.go | 2 +- commands/lib/uninstall.go | 4 +- commands/lib/upgrade.go | 2 +- commands/lib/utils.go | 4 +- commands/sketch/archive.go | 15 +- commands/upload/programmers_list.go | 6 +- commands/upload/upload.go | 77 +- configuration/configuration.go | 17 +- executils/executils.go | 4 + executils/output.go | 4 +- executils/process.go | 2 +- httpclient/httpclient.go | 4 + httpclient/httpclient_config.go | 3 +- i18n/data/en.po | 3310 ++++++++++++++++- i18n/rice-box.go | 14 +- inventory/inventory.go | 12 +- legacy/builder/builder.go | 15 +- legacy/builder/builder_utils/utils.go | 31 +- legacy/builder/constants/constants.go | 104 +- legacy/builder/container_find_includes.go | 2 +- legacy/builder/container_setup.go | 2 +- legacy/builder/ctags_runner.go | 2 +- legacy/builder/phases/core_builder.go | 9 +- legacy/builder/phases/libraries_builder.go | 14 +- legacy/builder/phases/linker.go | 2 +- legacy/builder/phases/sizer.go | 17 +- legacy/builder/preprocess_sketch.go | 2 +- legacy/builder/recipe_runner.go | 2 +- legacy/builder/resolve_library.go | 4 +- legacy/builder/target_board_resolver.go | 2 +- legacy/builder/types/context.go | 2 +- legacy/builder/types/types.go | 3 + legacy/builder/utils/utils.go | 7 +- ...out_build_path_if_build_options_changed.go | 4 +- version/version.go | 5 +- 143 files changed, 4374 insertions(+), 1024 deletions(-) diff --git a/arduino/builder/compilation_database.go b/arduino/builder/compilation_database.go index f00c74eb303..767bcaa8e8f 100644 --- a/arduino/builder/compilation_database.go +++ b/arduino/builder/compilation_database.go @@ -60,10 +60,10 @@ func LoadCompilationDatabase(file *paths.Path) (*CompilationDatabase, error) { // see https://clang.llvm.org/docs/JSONCompilationDatabase.html func (db *CompilationDatabase) SaveToFile() { if jsonContents, err := json.MarshalIndent(db.Contents, "", " "); err != nil { - fmt.Printf("Error serializing compilation database: %s", err) + fmt.Printf(tr("Error serializing compilation database: %s"), err) return } else if err := db.File.WriteFile(jsonContents); err != nil { - fmt.Printf("Error writing compilation database: %s", err) + fmt.Printf(tr("Error writing compilation database: %s"), err) } } @@ -75,7 +75,7 @@ func dirForCommand(command *exec.Cmd) string { } dir, err := os.Getwd() if err != nil { - fmt.Printf("Error getting current directory for compilation database: %s", err) + fmt.Printf(tr("Error getting current directory for compilation database: %s"), err) return "" } return dir diff --git a/arduino/builder/sketch.go b/arduino/builder/sketch.go index 14ae39d4fd9..78815fcbe05 100644 --- a/arduino/builder/sketch.go +++ b/arduino/builder/sketch.go @@ -22,12 +22,16 @@ import ( "strings" "github.com/arduino/arduino-cli/arduino/sketch" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/go-paths-helper" "github.com/pkg/errors" ) -var includesArduinoH = regexp.MustCompile(`(?m)^\s*#\s*include\s*[<\"]Arduino\.h[>\"]`) +var ( + includesArduinoH = regexp.MustCompile(`(?m)^\s*#\s*include\s*[<\"]Arduino\.h[>\"]`) + tr = i18n.Tr +) // QuoteCppString returns the given string as a quoted string for use with the C // preprocessor. This adds double quotes around it and escapes any @@ -42,13 +46,13 @@ func QuoteCppString(str string) string { func SketchSaveItemCpp(path *paths.Path, contents []byte, destPath *paths.Path) error { sketchName := path.Base() if err := destPath.MkdirAll(); err != nil { - return errors.Wrap(err, "unable to create a folder to save the sketch") + return errors.Wrap(err, tr("unable to create a folder to save the sketch")) } destFile := destPath.Join(fmt.Sprintf("%s.cpp", sketchName)) if err := destFile.WriteFile(contents); err != nil { - return errors.Wrap(err, "unable to save the sketch on disk") + return errors.Wrap(err, tr("unable to save the sketch on disk")) } return nil @@ -62,14 +66,14 @@ func SketchMergeSources(sk *sketch.Sketch, overrides map[string]string) (int, st getSource := func(f *paths.Path) (string, error) { path, err := sk.FullPath.RelTo(f) if err != nil { - return "", errors.Wrap(err, "unable to compute relative path to the sketch for the item") + return "", errors.Wrap(err, tr("unable to compute relative path to the sketch for the item")) } if override, ok := overrides[path.String()]; ok { return override, nil } data, err := f.ReadFile() if err != nil { - return "", fmt.Errorf("reading file %s: %s", f, err) + return "", fmt.Errorf(tr("reading file %[1]s: %[2]s"), f, err) } return string(data), nil } @@ -104,19 +108,19 @@ func SketchMergeSources(sk *sketch.Sketch, overrides map[string]string) (int, st // specified destination directory. func SketchCopyAdditionalFiles(sketch *sketch.Sketch, destPath *paths.Path, overrides map[string]string) error { if err := destPath.MkdirAll(); err != nil { - return errors.Wrap(err, "unable to create a folder to save the sketch files") + return errors.Wrap(err, tr("unable to create a folder to save the sketch files")) } for _, file := range sketch.AdditionalFiles { relpath, err := sketch.FullPath.RelTo(file) if err != nil { - return errors.Wrap(err, "unable to compute relative path to the sketch for the item") + return errors.Wrap(err, tr("unable to compute relative path to the sketch for the item")) } targetPath := destPath.JoinPath(relpath) // create the directory containing the target if err = targetPath.Parent().MkdirAll(); err != nil { - return errors.Wrap(err, "unable to create the folder containing the item") + return errors.Wrap(err, tr("unable to create the folder containing the item")) } var sourceBytes []byte @@ -127,7 +131,7 @@ func SketchCopyAdditionalFiles(sketch *sketch.Sketch, destPath *paths.Path, over // read the source file s, err := file.ReadFile() if err != nil { - return errors.Wrap(err, "unable to read contents of the source item") + return errors.Wrap(err, tr("unable to read contents of the source item")) } sourceBytes = s } @@ -137,7 +141,7 @@ func SketchCopyAdditionalFiles(sketch *sketch.Sketch, destPath *paths.Path, over err = writeIfDifferent(sourceBytes, targetPath) if err != nil { - return errors.Wrap(err, "unable to write to destination file") + return errors.Wrap(err, tr("unable to write to destination file")) } } @@ -154,7 +158,7 @@ func writeIfDifferent(source []byte, destPath *paths.Path) error { // Read the destination file if it exists existingBytes, err := destPath.ReadFile() if err != nil { - return errors.Wrap(err, "unable to read contents of the destination item") + return errors.Wrap(err, tr("unable to read contents of the destination item")) } // Overwrite if contents are different diff --git a/arduino/cores/board.go b/arduino/cores/board.go index c16ee1e6ee4..23381c2bf2f 100644 --- a/arduino/cores/board.go +++ b/arduino/cores/board.go @@ -106,7 +106,7 @@ func (b *Board) GetBuildProperties(userConfigs *properties.Map) (*properties.Map if haveUserValue { userConfigs.Remove(option) if !optionMenu.ContainsKey(userValue) { - return nil, fmt.Errorf("invalid value '%s' for option '%s'", userValue, option) + return nil, fmt.Errorf(tr("invalid value '%[1]s' for option '%[2]s'"), userValue, option) } } else { // apply default @@ -120,9 +120,9 @@ func (b *Board) GetBuildProperties(userConfigs *properties.Map) (*properties.Map // Check for residual invalid options... for _, invalidOption := range userConfigs.Keys() { if invalidOption == "" { - return nil, fmt.Errorf("invalid empty option found") + return nil, fmt.Errorf(tr("invalid empty option found")) } - return nil, fmt.Errorf("invalid option '%s'", invalidOption) + return nil, fmt.Errorf(tr("invalid option '%s'"), invalidOption) } return buildProperties, nil @@ -136,7 +136,7 @@ func (b *Board) GetBuildProperties(userConfigs *properties.Map) (*properties.Map func (b *Board) GeneratePropertiesForConfiguration(config string) (*properties.Map, error) { fqbn, err := ParseFQBN(b.String() + ":" + config) if err != nil { - return nil, fmt.Errorf("parsing fqbn: %s", err) + return nil, fmt.Errorf(tr("parsing fqbn: %s"), err) } return b.GetBuildProperties(fqbn.Configs) } diff --git a/arduino/cores/cores.go b/arduino/cores/cores.go index 495163ce417..ae18edc71a6 100644 --- a/arduino/cores/cores.go +++ b/arduino/cores/cores.go @@ -22,6 +22,7 @@ import ( "strings" "github.com/arduino/arduino-cli/arduino/resources" + "github.com/arduino/arduino-cli/i18n" paths "github.com/arduino/go-paths-helper" properties "github.com/arduino/go-properties-orderedmap" semver "go.bug.st/relaxed-semver" @@ -75,6 +76,8 @@ type BoardManifestID struct { USB string `json:"-"` } +var tr = i18n.Tr + // HasUsbID returns true if the BoardManifes contains the specified USB id as // identification for this board. usbID should be in the format "0000:0000" func (bm *BoardManifest) HasUsbID(vid, pid string) bool { diff --git a/arduino/cores/fqbn.go b/arduino/cores/fqbn.go index 19b95d2f11c..e107cdda168 100644 --- a/arduino/cores/fqbn.go +++ b/arduino/cores/fqbn.go @@ -45,18 +45,18 @@ func ParseFQBN(fqbnIn string) (*FQBN, error) { Configs: properties.NewMap(), } if fqbn.BoardID == "" { - return nil, fmt.Errorf("invalid fqbn: empty board identifier") + return nil, fmt.Errorf(tr("invalid fqbn: empty board identifier")) } if len(fqbnParts) > 3 { for _, pair := range strings.Split(fqbnParts[3], ",") { parts := strings.SplitN(pair, "=", 2) if len(parts) != 2 { - return nil, fmt.Errorf("invalid fqbn config: %s", pair) + return nil, fmt.Errorf(tr("invalid fqbn config: %s"), pair) } k := strings.TrimSpace(parts[0]) v := strings.TrimSpace(parts[1]) if k == "" { - return nil, fmt.Errorf("invalid fqbn config: %s", pair) + return nil, fmt.Errorf(tr("invalid fqbn config: %s"), pair) } fqbn.Configs.Set(k, v) } diff --git a/arduino/cores/packageindex/index.go b/arduino/cores/packageindex/index.go index c718ed6ace2..471cd0e6742 100644 --- a/arduino/cores/packageindex/index.go +++ b/arduino/cores/packageindex/index.go @@ -22,6 +22,7 @@ import ( "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/arduino/resources" "github.com/arduino/arduino-cli/arduino/security" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/go-paths-helper" "github.com/sirupsen/logrus" semver "go.bug.st/relaxed-semver" @@ -107,6 +108,8 @@ type indexHelp struct { Online string `json:"online,omitempty"` } +var tr = i18n.Tr + // MergeIntoPackages converts the Index data into a cores.Packages and merge them // with the existing contents of the cores.Packages passed as parameter. func (index Index) MergeIntoPackages(outPackages cores.Packages) { @@ -233,7 +236,7 @@ func (inPlatformRelease indexPlatformRelease) extractPlatformIn(outPackage *core size, err := inPlatformRelease.Size.Int64() if err != nil { - return fmt.Errorf("invalid platform archive size: %s", err) + return fmt.Errorf(tr("invalid platform archive size: %s"), err) } outPlatformRelease := outPlatform.GetOrCreateRelease(inPlatformRelease.Version) outPlatformRelease.IsTrusted = trusted diff --git a/arduino/cores/packagemanager/download.go b/arduino/cores/packagemanager/download.go index c6dc0bc1d9d..6dceb8feccc 100644 --- a/arduino/cores/packagemanager/download.go +++ b/arduino/cores/packagemanager/download.go @@ -70,37 +70,37 @@ func (pm *PackageManager) FindPlatformRelease(ref *PlatformReference) *cores.Pla func (pm *PackageManager) FindPlatformReleaseDependencies(item *PlatformReference) (*cores.PlatformRelease, []*cores.ToolRelease, error) { targetPackage, exists := pm.Packages[item.Package] if !exists { - return nil, nil, fmt.Errorf("package %s not found", item.Package) + return nil, nil, fmt.Errorf(tr("package %s not found"), item.Package) } platform, exists := targetPackage.Platforms[item.PlatformArchitecture] if !exists { - return nil, nil, fmt.Errorf("platform %s not found in package %s", item.PlatformArchitecture, targetPackage.String()) + return nil, nil, fmt.Errorf(tr("platform %[1]s not found in package %[2]s"), item.PlatformArchitecture, targetPackage.String()) } var release *cores.PlatformRelease if item.PlatformVersion != nil { release = platform.FindReleaseWithVersion(item.PlatformVersion) if release == nil { - return nil, nil, fmt.Errorf("required version %s not found for platform %s", item.PlatformVersion, platform.String()) + return nil, nil, fmt.Errorf(tr("required version %[1]s not found for platform %[2]s"), item.PlatformVersion, platform.String()) } } else { release = platform.GetLatestRelease() if release == nil { - return nil, nil, fmt.Errorf("platform %s has no available releases", platform.String()) + return nil, nil, fmt.Errorf(tr("platform %s has no available releases"), platform.String()) } } // replaces "latest" with latest version too toolDeps, err := pm.Packages.GetPlatformReleaseToolDependencies(release) if err != nil { - return nil, nil, fmt.Errorf("getting tool dependencies for platform %s: %s", release.String(), err) + return nil, nil, fmt.Errorf(tr("getting tool dependencies for platform %[1]s: %[2]s"), release.String(), err) } // discovery dependencies differ from normal tool since we always want to use the latest \ // available version for the platform package discoveryDependencies, err := pm.Packages.GetPlatformReleaseDiscoveryDependencies(release) if err != nil { - return nil, nil, fmt.Errorf("getting discovery dependencies for platform %s: %s", release.String(), err) + return nil, nil, fmt.Errorf(tr("getting discovery dependencies for platform %[1]s: %[2]s"), release.String(), err) } return release, append(toolDeps, discoveryDependencies...), nil @@ -111,7 +111,7 @@ func (pm *PackageManager) FindPlatformReleaseDependencies(item *PlatformReferenc func (pm *PackageManager) DownloadToolRelease(tool *cores.ToolRelease, config *downloader.Config) (*downloader.Downloader, error) { resource := tool.GetCompatibleFlavour() if resource == nil { - return nil, fmt.Errorf("tool not available for your OS") + return nil, fmt.Errorf(tr("tool not available for your OS")) } return resource.Download(pm.DownloadDir, config) } diff --git a/arduino/cores/packagemanager/install_uninstall.go b/arduino/cores/packagemanager/install_uninstall.go index 63c548c958e..4a0e11d752d 100644 --- a/arduino/cores/packagemanager/install_uninstall.go +++ b/arduino/cores/packagemanager/install_uninstall.go @@ -34,7 +34,7 @@ func (pm *PackageManager) InstallPlatform(platformRelease *cores.PlatformRelease platformRelease.Platform.Architecture, platformRelease.Version.String()) if err := platformRelease.Resource.Install(pm.DownloadDir, pm.TempDir, destDir); err != nil { - return errors.Errorf("installing platform %s: %s", platformRelease, err) + return errors.Errorf(tr("installing platform %[1]s: %[2]s"), platformRelease, err) } if d, err := destDir.Abs(); err == nil { platformRelease.InstallDir = d @@ -42,7 +42,7 @@ func (pm *PackageManager) InstallPlatform(platformRelease *cores.PlatformRelease return err } if err := pm.cacheInstalledJSON(platformRelease); err != nil { - return errors.Errorf("creating installed.json in %s: %s", platformRelease.InstallDir, err) + return errors.Errorf(tr("creating installed.json in %[1]s: %[2]s"), platformRelease.InstallDir, err) } return nil } @@ -62,7 +62,7 @@ func (pm *PackageManager) cacheInstalledJSON(platformRelease *cores.PlatformRele // specified platformRelease. func (pm *PackageManager) RunPostInstallScript(platformRelease *cores.PlatformRelease) error { if !platformRelease.IsInstalled() { - return errors.New("platform not installed") + return errors.New(tr("platform not installed")) } postInstallFilename := "post_install.sh" if runtime.GOOS == "windows" { @@ -105,16 +105,16 @@ func (pm *PackageManager) IsManagedPlatformRelease(platformRelease *cores.Platfo // UninstallPlatform remove a PlatformRelease. func (pm *PackageManager) UninstallPlatform(platformRelease *cores.PlatformRelease) error { if platformRelease.InstallDir == nil { - return fmt.Errorf("platform not installed") + return fmt.Errorf(tr("platform not installed")) } // Safety measure if !pm.IsManagedPlatformRelease(platformRelease) { - return fmt.Errorf("%s is not managed by package manager", platformRelease) + return fmt.Errorf(tr("%s is not managed by package manager"), platformRelease) } if err := platformRelease.InstallDir.RemoveAll(); err != nil { - return fmt.Errorf("removing platform files: %s", err) + return fmt.Errorf(tr("removing platform files: %s"), err) } platformRelease.InstallDir = nil return nil @@ -124,7 +124,7 @@ func (pm *PackageManager) UninstallPlatform(platformRelease *cores.PlatformRelea func (pm *PackageManager) InstallTool(toolRelease *cores.ToolRelease) error { toolResource := toolRelease.GetCompatibleFlavour() if toolResource == nil { - return fmt.Errorf("no compatible version of %s tools found for the current os", toolRelease.Tool.Name) + return fmt.Errorf(tr("no compatible version of %s tools found for the current os"), toolRelease.Tool.Name) } destDir := pm.PackagesDir.Join( toolRelease.Tool.Package.Name, @@ -157,16 +157,16 @@ func (pm *PackageManager) IsManagedToolRelease(toolRelease *cores.ToolRelease) b // UninstallTool remove a ToolRelease. func (pm *PackageManager) UninstallTool(toolRelease *cores.ToolRelease) error { if toolRelease.InstallDir == nil { - return fmt.Errorf("tool not installed") + return fmt.Errorf(tr("tool not installed")) } // Safety measure if !pm.IsManagedToolRelease(toolRelease) { - return fmt.Errorf("tool %s is not managed by package manager", toolRelease) + return fmt.Errorf(tr("tool %s is not managed by package manager"), toolRelease) } if err := toolRelease.InstallDir.RemoveAll(); err != nil { - return fmt.Errorf("removing tool files: %s", err) + return fmt.Errorf(tr("removing tool files: %s"), err) } toolRelease.InstallDir = nil return nil diff --git a/arduino/cores/packagemanager/loader.go b/arduino/cores/packagemanager/loader.go index 0da0171ce96..7e7b9d129f8 100644 --- a/arduino/cores/packagemanager/loader.go +++ b/arduino/cores/packagemanager/loader.go @@ -62,19 +62,19 @@ func (pm *PackageManager) LoadHardwareFromDirectory(path *paths.Path) []*status. pm.Log.Infof("Loading hardware from: %s", path) statuses := []*status.Status{} if err := path.ToAbs(); err != nil { - s := status.Newf(codes.FailedPrecondition, "find abs path: %s", err) + s := status.Newf(codes.FailedPrecondition, tr("find abs path: %s"), err) return append(statuses, s) } if path.IsNotDir() { - s := status.Newf(codes.FailedPrecondition, "%s is not a directory", path) + s := status.Newf(codes.FailedPrecondition, tr("%s is not a directory"), path) return append(statuses, s) } // Scan subdirs packagersPaths, err := path.ReadDir() if err != nil { - s := status.Newf(codes.FailedPrecondition, "reading %s directory: %s", path, err) + s := status.Newf(codes.FailedPrecondition, tr("reading %[1]s directory: %[2]s"), path, err) return append(statuses, s) } packagersPaths.FilterOutHiddenFiles() @@ -104,7 +104,7 @@ func (pm *PackageManager) LoadHardwareFromDirectory(path *paths.Path) []*status. // Follow symlinks err := packagerPath.FollowSymLink() // ex: .arduino15/packages/arduino/ if err != nil { - s := status.Newf(codes.Internal, "following possible symlink %s: %s", path, err) + s := status.Newf(codes.Internal, tr("following possible symlink %[1]s: %[2]s"), path, err) statuses = append(statuses, s) continue } @@ -158,7 +158,7 @@ func (pm *PackageManager) loadPlatforms(targetPackage *cores.Package, packageDir platformsDirs, err := packageDir.ReadDir() if err != nil { - s := status.Newf(codes.FailedPrecondition, "reading directory %s: %s", packageDir, err) + s := status.Newf(codes.FailedPrecondition, tr("reading directory %[1]s: %[2]s"), packageDir, err) return append(statuses, s) } @@ -185,7 +185,7 @@ func (pm *PackageManager) loadPlatforms(targetPackage *cores.Package, packageDir func (pm *PackageManager) loadPlatform(targetPackage *cores.Package, platformPath *paths.Path) *status.Status { // This is not a platform if platformPath.IsNotDir() { - return status.Newf(codes.NotFound, "path is not a platform directory: %s", platformPath) + return status.Newf(codes.NotFound, tr("path is not a platform directory: %s"), platformPath) } architecture := platformPath.Base() @@ -196,14 +196,14 @@ func (pm *PackageManager) loadPlatform(targetPackage *cores.Package, platformPat // We identify them by checking where is the bords.txt file possibleBoardTxtPath := platformPath.Join("boards.txt") if exist, err := possibleBoardTxtPath.ExistCheck(); err != nil { - return status.Newf(codes.FailedPrecondition, "looking for boards.txt in %s: %s", possibleBoardTxtPath, err) + return status.Newf(codes.FailedPrecondition, tr("looking for boards.txt in %[1]s: %[2]s"), possibleBoardTxtPath, err) } else if exist { // case: ARCHITECTURE/boards.txt platformTxtPath := platformPath.Join("platform.txt") platformProperties, err := properties.SafeLoad(platformTxtPath.String()) if err != nil { - return status.Newf(codes.FailedPrecondition, "loading platform.txt: %v", err) + return status.Newf(codes.FailedPrecondition, tr("loading platform.txt: %v"), err) } version := semver.MustParse(platformProperties.Get("version")) @@ -223,7 +223,7 @@ func (pm *PackageManager) loadPlatform(targetPackage *cores.Package, platformPat // Parse the bundled index and merge to the general index index, err := pm.LoadPackageIndexFromFile(packageBundledIndexPath) if err != nil { - return status.Newf(codes.FailedPrecondition, "parsing IDE bundled index: %s", err) + return status.Newf(codes.FailedPrecondition, tr("parsing IDE bundled index: %s"), err) } // Now export the bundled index in a temporary core.Packages to retrieve the bundled package version @@ -252,7 +252,7 @@ func (pm *PackageManager) loadPlatform(targetPackage *cores.Package, platformPat pm.Log.Infof("Package is built-in") } if err := pm.loadPlatformRelease(release, platformPath); err != nil { - return status.Newf(codes.FailedPrecondition, "loading platform release %s: %s", release, err) + return status.Newf(codes.FailedPrecondition, tr("loading platform release %[1]s: %[2]s"), release, err) } pm.Log.WithField("platform", release).Infof("Loaded platform") @@ -263,24 +263,24 @@ func (pm *PackageManager) loadPlatform(targetPackage *cores.Package, platformPat platform := targetPackage.GetOrCreatePlatform(architecture) versionDirs, err := platformPath.ReadDir() if err != nil { - return status.Newf(codes.FailedPrecondition, "reading dir %s: %s", platformPath, err) + return status.Newf(codes.FailedPrecondition, tr("reading dir %[1]s: %[2]s"), platformPath, err) } versionDirs.FilterDirs() versionDirs.FilterOutHiddenFiles() for _, versionDir := range versionDirs { if exist, err := versionDir.Join("boards.txt").ExistCheck(); err != nil { - return status.Newf(codes.FailedPrecondition, "opening boards.txt: %s", err) + return status.Newf(codes.FailedPrecondition, tr("opening boards.txt: %s"), err) } else if !exist { continue } version, err := semver.Parse(versionDir.Base()) if err != nil { - return status.Newf(codes.FailedPrecondition, "invalid version dir %s: %s", versionDir, err) + return status.Newf(codes.FailedPrecondition, tr("invalid version dir %[1]s: %[2]s"), versionDir, err) } release := platform.GetOrCreateRelease(version) if err := pm.loadPlatformRelease(release, versionDir); err != nil { - return status.Newf(codes.FailedPrecondition, "loading platform release %s: %s", release, err) + return status.Newf(codes.FailedPrecondition, tr("loading platform release %[1]s: %[2]s"), release, err) } pm.Log.WithField("platform", release).Infof("Loaded platform") } @@ -303,7 +303,7 @@ func (pm *PackageManager) loadPlatformRelease(platform *cores.PlatformRelease, p // if we don't load it some information about the platform is lost if installedJSONPath.Exist() { if _, err := pm.LoadPackageIndexFromFile(installedJSONPath); err != nil { - return fmt.Errorf("loading %s: %s", installedJSONPath, err) + return fmt.Errorf(tr("loading %[1]s: %[2]s"), installedJSONPath, err) } } @@ -312,12 +312,12 @@ func (pm *PackageManager) loadPlatformRelease(platform *cores.PlatformRelease, p if p, err := properties.SafeLoad(platformTxtPath.String()); err == nil { platform.Properties.Merge(p) } else { - return fmt.Errorf("loading %s: %s", platformTxtPath, err) + return fmt.Errorf(tr("loading %[1]s: %[2]s"), platformTxtPath, err) } if p, err := properties.SafeLoad(platformTxtLocalPath.String()); err == nil { platform.Properties.Merge(p) } else { - return fmt.Errorf("loading %s: %s", platformTxtLocalPath, err) + return fmt.Errorf(tr("loading %[1]s: %[2]s"), platformTxtLocalPath, err) } if platform.Properties.SubTree("discovery").Size() > 0 { @@ -346,7 +346,7 @@ func (pm *PackageManager) loadPlatformRelease(platform *cores.PlatformRelease, p } if err := pm.loadBoards(platform); err != nil { - return fmt.Errorf("loading boards: %s", err) + return fmt.Errorf(tr("loading boards: %s"), err) } return nil @@ -361,7 +361,7 @@ func (pm *PackageManager) loadProgrammer(programmerProperties *properties.Map) * func (pm *PackageManager) loadBoards(platform *cores.PlatformRelease) error { if platform.InstallDir == nil { - return fmt.Errorf("platform not installed") + return fmt.Errorf(tr("platform not installed")) } boardsTxtPath := platform.InstallDir.Join("boards.txt") @@ -424,7 +424,7 @@ func (pm *PackageManager) loadBoards(platform *cores.PlatformRelease) error { } if len(skippedBoards) > 0 { - return fmt.Errorf("skipping loading of boards %s: malformed custom board options", strings.Join(skippedBoards, ", ")) + return fmt.Errorf(tr("skipping loading of boards %s: malformed custom board options"), strings.Join(skippedBoards, ", ")) } return nil @@ -474,7 +474,7 @@ func (pm *PackageManager) loadToolsFromPackage(targetPackage *cores.Package, too statuses := []*status.Status{} toolsPaths, err := toolsPath.ReadDir() if err != nil { - s := status.Newf(codes.FailedPrecondition, "reading directory %s: %s", toolsPath, err) + s := status.Newf(codes.FailedPrecondition, tr("reading directory %[1]s: %[2]s"), toolsPath, err) return append(statuses, s) } toolsPaths.FilterDirs() @@ -483,7 +483,7 @@ func (pm *PackageManager) loadToolsFromPackage(targetPackage *cores.Package, too name := toolPath.Base() tool := targetPackage.GetOrCreateTool(name) if err = pm.loadToolReleasesFromTool(tool, toolPath); err != nil { - s := status.Newf(codes.FailedPrecondition, "loading tool release in %s: %s", toolPath, err) + s := status.Newf(codes.FailedPrecondition, tr("loading tool release in %[1]s: %[2]s"), toolPath, err) statuses = append(statuses, s) } } @@ -516,7 +516,7 @@ func (pm *PackageManager) LoadToolsFromBundleDirectories(dirs paths.PathList) [] statuses := []*status.Status{} for _, dir := range dirs { if err := pm.LoadToolsFromBundleDirectory(dir); err != nil { - statuses = append(statuses, status.Newf(codes.FailedPrecondition, "loading bundled tools from %s: %s", dir, err)) + statuses = append(statuses, status.Newf(codes.FailedPrecondition, tr("loading bundled tools from %[1]s: %[2]s"), dir, err)) } } return statuses @@ -552,7 +552,7 @@ func (pm *PackageManager) LoadToolsFromBundleDirectory(toolsPath *paths.Path) er return nil } if err := filepath.Walk(toolsPath.String(), findBuiltInToolsVersionsTxt); err != nil { - return fmt.Errorf("searching for builtin_tools_versions.txt in %s: %s", toolsPath, err) + return fmt.Errorf(tr("searching for builtin_tools_versions.txt in %[1]s: %[2]s"), toolsPath, err) } if builtinToolsVersionsTxtPath != "" { @@ -561,12 +561,12 @@ func (pm *PackageManager) LoadToolsFromBundleDirectory(toolsPath *paths.Path) er pm.Log.Infof("Found builtin_tools_versions.txt") toolPath, err := paths.New(builtinToolsVersionsTxtPath).Parent().Abs() if err != nil { - return fmt.Errorf("getting parent dir of %s: %s", builtinToolsVersionsTxtPath, err) + return fmt.Errorf(tr("getting parent dir of %[1]s: %[2]s"), builtinToolsVersionsTxtPath, err) } all, err := properties.Load(builtinToolsVersionsTxtPath) if err != nil { - return fmt.Errorf("reading %s: %s", builtinToolsVersionsTxtPath, err) + return fmt.Errorf(tr("reading %[1]s: %[2]s"), builtinToolsVersionsTxtPath, err) } for packager, toolsData := range all.FirstLevelOf() { diff --git a/arduino/cores/packagemanager/package_manager.go b/arduino/cores/packagemanager/package_manager.go index cdbe2110c67..a4d0a728812 100644 --- a/arduino/cores/packagemanager/package_manager.go +++ b/arduino/cores/packagemanager/package_manager.go @@ -16,7 +16,6 @@ package packagemanager import ( - "errors" "fmt" "net/url" "path" @@ -24,6 +23,7 @@ import ( "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/arduino/cores/packageindex" + "github.com/arduino/arduino-cli/i18n" paths "github.com/arduino/go-paths-helper" properties "github.com/arduino/go-properties-orderedmap" "github.com/sirupsen/logrus" @@ -45,6 +45,8 @@ type PackageManager struct { CustomGlobalProperties *properties.Map } +var tr = i18n.Tr + // NewPackageManager returns a new instance of the PackageManager func NewPackageManager(indexDir, packagesDir, downloadDir, tempDir *paths.Path) *PackageManager { return &PackageManager{ @@ -122,7 +124,7 @@ func (pm *PackageManager) FindBoardsWithID(id string) []*cores.Board { func (pm *PackageManager) FindBoardWithFQBN(fqbnIn string) (*cores.Board, error) { fqbn, err := cores.ParseFQBN(fqbnIn) if err != nil { - return nil, fmt.Errorf("parsing fqbn: %s", err) + return nil, fmt.Errorf(tr("parsing fqbn: %s"), err) } _, _, board, _, _, err := pm.ResolveFQBN(fqbn) @@ -156,32 +158,32 @@ func (pm *PackageManager) ResolveFQBN(fqbn *cores.FQBN) ( targetPackage := pm.Packages[fqbn.Package] if targetPackage == nil { return nil, nil, nil, nil, nil, - errors.New("unknown package " + fqbn.Package) + fmt.Errorf(tr("unknown package %s"), fqbn.Package) } // Find platform platform := targetPackage.Platforms[fqbn.PlatformArch] if platform == nil { return targetPackage, nil, nil, nil, nil, - fmt.Errorf("unknown platform %s:%s", targetPackage, fqbn.PlatformArch) + fmt.Errorf(tr("unknown platform %s:%s"), targetPackage, fqbn.PlatformArch) } platformRelease := pm.GetInstalledPlatformRelease(platform) if platformRelease == nil { return targetPackage, nil, nil, nil, nil, - fmt.Errorf("platform %s is not installed", platform) + fmt.Errorf(tr("platform %s is not installed"), platform) } // Find board board := platformRelease.Boards[fqbn.BoardID] if board == nil { return targetPackage, platformRelease, nil, nil, nil, - fmt.Errorf("board %s:%s not found", platformRelease, fqbn.BoardID) + fmt.Errorf(tr("board %s:%s not found"), platformRelease, fqbn.BoardID) } buildProperties, err := board.GetBuildProperties(fqbn.Configs) if err != nil { return targetPackage, platformRelease, board, nil, nil, - fmt.Errorf("getting build properties for board %s: %s", board, err) + fmt.Errorf(tr("getting build properties for board %[1]s: %[2]s"), board, err) } // Determine the platform used for the build (in case the board refers @@ -193,17 +195,17 @@ func (pm *PackageManager) ResolveFQBN(fqbn *cores.FQBN) ( buildPackage := pm.Packages[referredPackage] if buildPackage == nil { return targetPackage, platformRelease, board, buildProperties, nil, - fmt.Errorf("missing package %s referenced by board %s", referredPackage, fqbn) + fmt.Errorf(tr("missing package %[1]s referenced by board %[2]s"), referredPackage, fqbn) } buildPlatform := buildPackage.Platforms[fqbn.PlatformArch] if buildPlatform == nil { return targetPackage, platformRelease, board, buildProperties, nil, - fmt.Errorf("missing platform %s:%s referenced by board %s", referredPackage, fqbn.PlatformArch, fqbn) + fmt.Errorf(tr("missing platform %[1]s:%[2]s referenced by board %[3]s"), referredPackage, fqbn.PlatformArch, fqbn) } buildPlatformRelease = pm.GetInstalledPlatformRelease(buildPlatform) if buildPlatformRelease == nil { return targetPackage, platformRelease, board, buildProperties, nil, - fmt.Errorf("missing platform release %s:%s referenced by board %s", referredPackage, fqbn.PlatformArch, fqbn) + fmt.Errorf(tr("missing platform release %[1]s:%[2]s referenced by board %[3]s"), referredPackage, fqbn.PlatformArch, fqbn) } } @@ -216,7 +218,7 @@ func (pm *PackageManager) LoadPackageIndex(URL *url.URL) error { indexPath := pm.IndexDir.Join(path.Base(URL.Path)) index, err := packageindex.LoadIndex(indexPath) if err != nil { - return fmt.Errorf("loading json index file %s: %s", indexPath, err) + return fmt.Errorf(tr("loading json index file %[1]s: %[2]s"), indexPath, err) } for _, p := range index.Packages { @@ -231,7 +233,7 @@ func (pm *PackageManager) LoadPackageIndex(URL *url.URL) error { func (pm *PackageManager) LoadPackageIndexFromFile(indexPath *paths.Path) (*packageindex.Index, error) { index, err := packageindex.LoadIndex(indexPath) if err != nil { - return nil, fmt.Errorf("loading json index file %s: %s", indexPath, err) + return nil, fmt.Errorf(tr("loading json index file %[1]s: %[2]s"), indexPath, err) } index.MergeIntoPackages(pm.Packages) @@ -245,7 +247,7 @@ func (pm *PackageManager) Package(name string) *PackageActions { var err error thePackage := pm.Packages[name] if thePackage == nil { - err = fmt.Errorf("package '%s' not found", name) + err = fmt.Errorf(tr("package '%s' not found"), name) } return &PackageActions{ aPackage: thePackage, @@ -271,7 +273,7 @@ func (pa *PackageActions) Tool(name string) *ToolActions { tool = pa.aPackage.Tools[name] if tool == nil { - err = fmt.Errorf("tool '%s' not found in package '%s'", name, pa.aPackage.Name) + err = fmt.Errorf(tr("tool '%[1]s' not found in package '%[2]s'"), name, pa.aPackage.Name) } } return &ToolActions{ @@ -321,7 +323,7 @@ func (ta *ToolActions) Release(version *semver.RelaxedVersion) *ToolReleaseActio } release := ta.tool.FindReleaseWithRelaxedVersion(version) if release == nil { - return &ToolReleaseActions{forwardError: fmt.Errorf("release %s not found for tool %s", version, ta.tool.String())} + return &ToolReleaseActions{forwardError: fmt.Errorf(tr("release %[1]s not found for tool %[2]s"), version, ta.tool.String())} } return &ToolReleaseActions{release: release} } @@ -472,7 +474,7 @@ func (pm *PackageManager) FindToolsRequiredForBoard(board *cores.Board) ([]*core pm.Log.WithField("tool", toolDep).Infof("Required tool") tool := pm.FindToolDependency(toolDep) if tool == nil { - return nil, fmt.Errorf("tool release not found: %s", toolDep) + return nil, fmt.Errorf(tr("tool release not found: %s"), toolDep) } requiredTools = append(requiredTools, tool) delete(foundTools, tool.Tool.Name) diff --git a/arduino/cores/status.go b/arduino/cores/status.go index ef8d998a053..7cee4be516c 100644 --- a/arduino/cores/status.go +++ b/arduino/cores/status.go @@ -79,21 +79,21 @@ func (packages Packages) Names() []string { // GetPlatformReleaseToolDependencies returns the tool releases needed by the specified PlatformRelease func (packages Packages) GetPlatformReleaseToolDependencies(release *PlatformRelease) ([]*ToolRelease, error) { if release == nil { - return nil, errors.New("release cannot be nil") + return nil, errors.New(tr("release cannot be nil")) } ret := []*ToolRelease{} for _, dep := range release.ToolDependencies { pkg, exists := packages[dep.ToolPackager] if !exists { - return nil, fmt.Errorf("package %s not found", dep.ToolPackager) + return nil, fmt.Errorf(tr("package %s not found"), dep.ToolPackager) } tool, exists := pkg.Tools[dep.ToolName] if !exists { - return nil, fmt.Errorf("tool %s not found", dep.ToolName) + return nil, fmt.Errorf(tr("tool %s not found"), dep.ToolName) } toolRelease, exists := tool.Releases[dep.ToolVersion.String()] if !exists { - return nil, fmt.Errorf("tool version %s not found", dep.ToolVersion) + return nil, fmt.Errorf(tr("tool version %s not found"), dep.ToolVersion) } ret = append(ret, toolRelease) } @@ -103,24 +103,24 @@ func (packages Packages) GetPlatformReleaseToolDependencies(release *PlatformRel // GetPlatformReleaseDiscoveryDependencies returns the discovery releases needed by the specified PlatformRelease func (packages Packages) GetPlatformReleaseDiscoveryDependencies(release *PlatformRelease) ([]*ToolRelease, error) { if release == nil { - return nil, fmt.Errorf("release cannot be nil") + return nil, fmt.Errorf(tr("release cannot be nil")) } res := []*ToolRelease{} for _, discovery := range release.DiscoveryDependencies { pkg, exists := packages[discovery.Packager] if !exists { - return nil, fmt.Errorf("package %s not found", discovery.Packager) + return nil, fmt.Errorf(tr("package %s not found"), discovery.Packager) } tool, exists := pkg.Tools[discovery.Name] if !exists { - return nil, fmt.Errorf("tool %s not found", discovery.Name) + return nil, fmt.Errorf(tr("tool %s not found"), discovery.Name) } // We always want to use the latest available release for discoveries latestRelease := tool.LatestRelease() if latestRelease == nil { - return nil, fmt.Errorf("can't find latest release of %s", discovery.Name) + return nil, fmt.Errorf(tr("can't find latest release of %s"), discovery.Name) } res = append(res, latestRelease) } @@ -164,11 +164,11 @@ func (targetPackage *Package) String() string { func (tdep ToolDependency) extractTool(sc Packages) (*Tool, error) { pkg, exists := sc[tdep.ToolPackager] if !exists { - return nil, errors.New("package not found") + return nil, errors.New(tr("package not found")) } tool, exists := pkg.Tools[tdep.ToolName] if !exists { - return nil, errors.New("tool not found") + return nil, errors.New(tr("tool not found")) } return tool, nil } @@ -180,7 +180,7 @@ func (tdep ToolDependency) extractRelease(sc Packages) (*ToolRelease, error) { } release, exists := tool.Releases[tdep.ToolVersion.String()] if !exists { - return nil, errors.New("release not found") + return nil, errors.New(tr("release not found")) } return release, nil } diff --git a/arduino/discovery/discovery.go b/arduino/discovery/discovery.go index fdc8c9d1b16..49b679e0d24 100644 --- a/arduino/discovery/discovery.go +++ b/arduino/discovery/discovery.go @@ -23,6 +23,7 @@ import ( "github.com/arduino/arduino-cli/cli/globals" "github.com/arduino/arduino-cli/executils" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/go-properties-orderedmap" "github.com/pkg/errors" ) @@ -62,6 +63,8 @@ type Port struct { Properties *properties.Map `json:"properties"` } +var tr = i18n.Tr + func (p *Port) String() string { if p == nil { return "none" @@ -128,7 +131,7 @@ func (disc *PluggableDiscovery) jsonDecodeLoop(in io.Reader, outChan chan<- *dis } if msg.EventType == "add" { if msg.Port == nil { - closeAndReportError(errors.New("invalid 'add' message: missing port")) + closeAndReportError(errors.New(tr("invalid 'add' message: missing port"))) return } disc.statusMutex.Lock() @@ -139,7 +142,7 @@ func (disc *PluggableDiscovery) jsonDecodeLoop(in io.Reader, outChan chan<- *dis disc.statusMutex.Unlock() } else if msg.EventType == "remove" { if msg.Port == nil { - closeAndReportError(errors.New("invalid 'remove' message: missing port")) + closeAndReportError(errors.New(tr("invalid 'remove' message: missing port"))) return } disc.statusMutex.Lock() @@ -221,11 +224,11 @@ func (disc *PluggableDiscovery) Run() error { if msg, err := disc.waitMessage(time.Second * 10); err != nil { return err } else if msg.EventType != "hello" { - return errors.Errorf("communication out of sync, expected 'hello', received '%s'", msg.EventType) + return errors.Errorf(tr("communication out of sync, expected 'hello', received '%s'"), msg.EventType) } else if msg.Message != "OK" || msg.Error { - return errors.Errorf("command failed: %s", msg.Message) + return errors.Errorf(tr("command failed: %s"), msg.Message) } else if msg.ProtocolVersion > 1 { - return errors.Errorf("protocol version not supported: requested 1, got %d", msg.ProtocolVersion) + return errors.Errorf(tr("protocol version not supported: requested 1, got %d"), msg.ProtocolVersion) } return nil } @@ -239,9 +242,9 @@ func (disc *PluggableDiscovery) Start() error { if msg, err := disc.waitMessage(time.Second * 10); err != nil { return err } else if msg.EventType != "start" { - return errors.Errorf("communication out of sync, expected 'start', received '%s'", msg.EventType) + return errors.Errorf(tr("communication out of sync, expected 'start', received '%s'"), msg.EventType) } else if msg.Message != "OK" || msg.Error { - return errors.Errorf("command failed: %s", msg.Message) + return errors.Errorf(tr("command failed: %s"), msg.Message) } return nil } @@ -256,9 +259,9 @@ func (disc *PluggableDiscovery) Stop() error { if msg, err := disc.waitMessage(time.Second * 10); err != nil { return err } else if msg.EventType != "stop" { - return errors.Errorf("communication out of sync, expected 'stop', received '%s'", msg.EventType) + return errors.Errorf(tr("communication out of sync, expected 'stop', received '%s'"), msg.EventType) } else if msg.Message != "OK" || msg.Error { - return errors.Errorf("command failed: %s", msg.Message) + return errors.Errorf(tr("command failed: %s"), msg.Message) } disc.statusMutex.Lock() defer disc.statusMutex.Unlock() @@ -278,9 +281,9 @@ func (disc *PluggableDiscovery) Quit() error { if msg, err := disc.waitMessage(time.Second * 10); err != nil { return err } else if msg.EventType != "quit" { - return errors.Errorf("communication out of sync, expected 'quit', received '%s'", msg.EventType) + return errors.Errorf(tr("communication out of sync, expected 'quit', received '%s'"), msg.EventType) } else if msg.Message != "OK" || msg.Error { - return errors.Errorf("command failed: %s", msg.Message) + return errors.Errorf(tr("command failed: %s"), msg.Message) } disc.statusMutex.Lock() defer disc.statusMutex.Unlock() @@ -301,9 +304,9 @@ func (disc *PluggableDiscovery) List() ([]*Port, error) { if msg, err := disc.waitMessage(time.Second * 10); err != nil { return nil, err } else if msg.EventType != "list" { - return nil, errors.Errorf("communication out of sync, expected 'list', received '%s'", msg.EventType) + return nil, errors.Errorf(tr("communication out of sync, expected 'list', received '%s'"), msg.EventType) } else if msg.Error { - return nil, errors.Errorf("command failed: %s", msg.Message) + return nil, errors.Errorf(tr("command failed: %s"), msg.Message) } else { return msg.Ports, nil } @@ -334,7 +337,7 @@ func (disc *PluggableDiscovery) StartSync() error { defer disc.statusMutex.Unlock() if disc.eventsMode { - return errors.New("already in events mode") + return errors.New(tr("already in events mode")) } if err := disc.sendCommand("START_SYNC\n"); err != nil { return err @@ -343,9 +346,9 @@ func (disc *PluggableDiscovery) StartSync() error { if msg, err := disc.waitMessage(time.Second * 10); err != nil { return err } else if msg.EventType != "start_sync" { - return errors.Errorf("communication out of sync, expected 'start_sync', received '%s'", msg.EventType) + return errors.Errorf(tr("communication out of sync, expected 'start_sync', received '%s'"), msg.EventType) } else if msg.Message != "OK" || msg.Error { - return errors.Errorf("command failed: %s", msg.Message) + return errors.Errorf(tr("command failed: %s"), msg.Message) } disc.eventsMode = true diff --git a/arduino/libraries/libraries.go b/arduino/libraries/libraries.go index 2a5a4288056..c3271742471 100644 --- a/arduino/libraries/libraries.go +++ b/arduino/libraries/libraries.go @@ -19,6 +19,7 @@ import ( "fmt" "github.com/arduino/arduino-cli/arduino/cores" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" paths "github.com/arduino/go-paths-helper" properties "github.com/arduino/go-properties-orderedmap" @@ -45,6 +46,8 @@ var ValidCategories = map[string]bool{ "Uncategorized": true, } +var tr = i18n.Tr + // Library represents a library in the system type Library struct { Name string @@ -108,7 +111,7 @@ func (library *Library) ToRPCLibrary() (*rpc.Library, error) { var err error headers, err = library.SourceHeaders() if err != nil { - return nil, fmt.Errorf("gathering library headers: %w", err) + return nil, fmt.Errorf(tr("gathering library headers: %w"), err) } } @@ -228,7 +231,7 @@ func (library *Library) SourceHeaders() ([]string, error) { if library.sourceHeaders == nil { cppHeaders, err := library.SourceDir.ReadDir() if err != nil { - return nil, fmt.Errorf("reading lib src dir: %s", err) + return nil, fmt.Errorf(tr("reading lib src dir: %s"), err) } cppHeaders.FilterSuffix(".h", ".hpp", ".hh") res := []string{} diff --git a/arduino/libraries/libraries_layout.go b/arduino/libraries/libraries_layout.go index ba2e3501607..2a85f95d5ce 100644 --- a/arduino/libraries/libraries_layout.go +++ b/arduino/libraries/libraries_layout.go @@ -50,7 +50,7 @@ func (d *LibraryLayout) MarshalJSON() ([]byte, error) { case RecursiveLayout: return json.Marshal("recursive") } - return nil, fmt.Errorf("invalid library layout value: %d", *d) + return nil, fmt.Errorf(tr("invalid library layout value: %d"), *d) } // UnmarshalJSON implements the json.Unmarshaler interface @@ -65,7 +65,7 @@ func (d *LibraryLayout) UnmarshalJSON(b []byte) error { case "recursive": *d = RecursiveLayout } - return fmt.Errorf("invalid library layout: %s", s) + return fmt.Errorf(tr("invalid library layout: %s"), s) } // ToRPCLibraryLayout converts this LibraryLayout to rpc.LibraryLayout diff --git a/arduino/libraries/libraries_location.go b/arduino/libraries/libraries_location.go index 9ac7aa7d8b6..e6bd933ebd6 100644 --- a/arduino/libraries/libraries_location.go +++ b/arduino/libraries/libraries_location.go @@ -70,7 +70,7 @@ func (d *LibraryLocation) MarshalJSON() ([]byte, error) { case Unmanaged: return json.Marshal("unmanaged") } - return nil, fmt.Errorf("invalid library location value: %d", *d) + return nil, fmt.Errorf(tr("invalid library location value: %d"), *d) } // UnmarshalJSON implements the json.Unmarshaler interface @@ -91,7 +91,7 @@ func (d *LibraryLocation) UnmarshalJSON(b []byte) error { case "unmanaged": *d = Unmanaged } - return fmt.Errorf("invalid library location: %s", s) + return fmt.Errorf(tr("invalid library location: %s"), s) } // ToRPCLibraryLocation converts this LibraryLocation to rpc.LibraryLocation diff --git a/arduino/libraries/librariesindex/json.go b/arduino/libraries/librariesindex/json.go index 0bc7145df14..99700dee20b 100644 --- a/arduino/libraries/librariesindex/json.go +++ b/arduino/libraries/librariesindex/json.go @@ -20,6 +20,7 @@ import ( "fmt" "github.com/arduino/arduino-cli/arduino/resources" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/go-paths-helper" semver "go.bug.st/relaxed-semver" ) @@ -53,17 +54,19 @@ type indexDependency struct { Version string `json:"version,omitempty"` } +var tr = i18n.Tr + // LoadIndex reads a library_index.json and create the corresponding Index func LoadIndex(indexFile *paths.Path) (*Index, error) { buff, err := indexFile.ReadFile() if err != nil { - return nil, fmt.Errorf("reading library_index.json: %s", err) + return nil, fmt.Errorf(tr("reading library_index.json: %s"), err) } var i indexJSON err = json.Unmarshal(buff, &i) if err != nil { - return nil, fmt.Errorf("parsing library_index.json: %s", err) + return nil, fmt.Errorf(tr("parsing library_index.json: %s"), err) } return i.extractIndex() diff --git a/arduino/libraries/librariesmanager/install.go b/arduino/libraries/librariesmanager/install.go index c9210fc5078..4e4ee7b6f9e 100644 --- a/arduino/libraries/librariesmanager/install.go +++ b/arduino/libraries/librariesmanager/install.go @@ -35,7 +35,7 @@ import ( var ( // ErrAlreadyInstalled is returned when a library is already installed and task // cannot proceed. - ErrAlreadyInstalled = errors.New("library already installed") + ErrAlreadyInstalled = errors.New(tr("library already installed")) ) // InstallPrerequisiteCheck performs prequisite checks to install a library. It returns the @@ -59,14 +59,14 @@ func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesinde libsDir := lm.getUserLibrariesDir() if libsDir == nil { - return nil, nil, fmt.Errorf("User directory not set") + return nil, nil, fmt.Errorf(tr("User directory not set")) } libPath := libsDir.Join(saneName) if replaced != nil && replaced.InstallDir.EquivalentTo(libPath) { } else if libPath.IsDir() { - return nil, nil, fmt.Errorf("destination dir %s already exists, cannot install", libPath) + return nil, nil, fmt.Errorf(tr("destination dir %s already exists, cannot install"), libPath) } return libPath, replaced, nil } @@ -75,7 +75,7 @@ func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesinde func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPath *paths.Path) error { libsDir := lm.getUserLibrariesDir() if libsDir == nil { - return fmt.Errorf("User directory not set") + return fmt.Errorf(tr("User directory not set")) } return indexLibrary.Resource.Install(lm.DownloadsDir, libsDir, libPath) } @@ -83,10 +83,10 @@ func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPat // Uninstall removes a Library func (lm *LibrariesManager) Uninstall(lib *libraries.Library) error { if lib == nil || lib.InstallDir == nil { - return fmt.Errorf("install directory not set") + return fmt.Errorf(tr("install directory not set")) } if err := lib.InstallDir.RemoveAll(); err != nil { - return fmt.Errorf("removing lib directory: %s", err) + return fmt.Errorf(tr("removing lib directory: %s"), err) } lm.Libraries[lib.Name].Remove(lib) @@ -97,7 +97,7 @@ func (lm *LibrariesManager) Uninstall(lib *libraries.Library) error { func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath string, overwrite bool) error { libsDir := lm.getUserLibrariesDir() if libsDir == nil { - return fmt.Errorf("User directory not set") + return fmt.Errorf(tr("User directory not set")) } tmpDir, err := paths.MkTempDir(paths.TempDir().String(), "arduino-cli-lib-") @@ -116,7 +116,7 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath strin // Extract to a temporary directory so we can check if the zip is structured correctly. // We also use the top level folder from the archive to infer the library name. if err := extract.Archive(ctx, file, tmpDir.String(), nil); err != nil { - return fmt.Errorf("extracting archive: %w", err) + return fmt.Errorf(tr("extracting archive: %w"), err) } paths, err := tmpDir.ReadDir() @@ -128,7 +128,7 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath strin paths.FilterOutPrefix("__MACOSX") if len(paths) > 1 { - return fmt.Errorf("archive is not valid: multiple files found in zip file top level") + return fmt.Errorf(tr("archive is not valid: multiple files found in zip file top level")) } extractionPath := paths[0] @@ -154,7 +154,7 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath strin // Delete library folder if already installed if installPath.IsDir() { if !overwrite { - return fmt.Errorf("library %s already installed", libraryName) + return fmt.Errorf(tr("library %s already installed"), libraryName) } logrus. WithField("library name", libraryName). @@ -171,7 +171,7 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath strin // Copy extracted library in the destination directory if err := extractionPath.CopyDirTo(installPath); err != nil { - return fmt.Errorf("moving extracted archive to destination dir: %s", err) + return fmt.Errorf(tr("moving extracted archive to destination dir: %s"), err) } return nil @@ -181,7 +181,7 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath strin func (lm *LibrariesManager) InstallGitLib(gitURL string, overwrite bool) error { libsDir := lm.getUserLibrariesDir() if libsDir == nil { - return fmt.Errorf("User directory not set") + return fmt.Errorf(tr("User directory not set")) } libraryName, err := parseGitURL(gitURL) @@ -197,7 +197,7 @@ func (lm *LibrariesManager) InstallGitLib(gitURL string, overwrite bool) error { // Deletes libraries folder if already installed if _, ok := lm.Libraries[libraryName]; ok { if !overwrite { - return fmt.Errorf("library %s already installed", libraryName) + return fmt.Errorf(tr("library %s already installed"), libraryName) } logrus. WithField("library name", libraryName). @@ -247,7 +247,7 @@ func parseGitURL(gitURL string) (string, error) { i := strings.LastIndex(parsed.Path, "/") res = strings.TrimRight(parsed.Path[i+1:], ".git") } else { - return "", fmt.Errorf("invalid git url") + return "", fmt.Errorf(tr("invalid git url")) } return res, nil } @@ -261,12 +261,12 @@ func validateLibrary(name string, dir *paths.Path) error { // https://arduino.github.io/arduino-cli/latest/library-specification/#source-code libraryHeader := name + ".h" if !dir.Join("src", libraryHeader).Exist() && !dir.Join(libraryHeader).Exist() { - return fmt.Errorf(`library is not valid: missing header file "%s"`, libraryHeader) + return fmt.Errorf(tr(`library is not valid: missing header file "%s"`), libraryHeader) } // Verifies library contains library.properties if !dir.Join("library.properties").Exist() { - return fmt.Errorf(`library is not valid: missing file "library.properties"`) + return fmt.Errorf(tr(`library is not valid: missing file "library.properties"`)) } return nil diff --git a/arduino/libraries/librariesmanager/librariesmanager.go b/arduino/libraries/librariesmanager/librariesmanager.go index 63da765f0cc..2aea86a2aa2 100644 --- a/arduino/libraries/librariesmanager/librariesmanager.go +++ b/arduino/libraries/librariesmanager/librariesmanager.go @@ -23,6 +23,7 @@ import ( "github.com/arduino/arduino-cli/arduino/libraries" "github.com/arduino/arduino-cli/arduino/libraries/librariesindex" "github.com/arduino/arduino-cli/arduino/utils" + "github.com/arduino/arduino-cli/i18n" paths "github.com/arduino/go-paths-helper" "github.com/pmylund/sortutil" "github.com/sirupsen/logrus" @@ -56,10 +57,12 @@ type LibraryAlternatives struct { Alternatives libraries.List } +var tr = i18n.Tr + // Add adds a library to the alternatives func (alts *LibraryAlternatives) Add(library *libraries.Library) { if len(alts.Alternatives) > 0 && alts.Alternatives[0].Name != library.Name { - panic(fmt.Sprintf("the library name is different from the set (%s != %s)", alts.Alternatives[0].Name, library.Name)) + panic(fmt.Sprintf(tr("the library name is different from the set (%[1]s != %[2]s)"), alts.Alternatives[0].Name, library.Name)) } alts.Alternatives = append(alts.Alternatives, library) } @@ -190,7 +193,7 @@ func (lm *LibrariesManager) LoadLibrariesFromDir(librariesDir *LibrariesDir) []* return statuses } if err != nil { - s := status.Newf(codes.FailedPrecondition, "reading dir %s: %s", librariesDir.Path, err) + s := status.Newf(codes.FailedPrecondition, tr("reading dir %[1]s: %[2]s"), librariesDir.Path, err) return append(statuses, s) } subDirs.FilterDirs() @@ -199,7 +202,7 @@ func (lm *LibrariesManager) LoadLibrariesFromDir(librariesDir *LibrariesDir) []* for _, subDir := range subDirs { library, err := libraries.Load(subDir, librariesDir.Location) if err != nil { - s := status.Newf(codes.Internal, "loading library from %s: %s", subDir, err) + s := status.Newf(codes.Internal, tr("loading library from %[1]s: %[2]s"), subDir, err) statuses = append(statuses, s) continue } @@ -220,12 +223,12 @@ func (lm *LibrariesManager) LoadLibrariesFromDir(librariesDir *LibrariesDir) []* // An error is returned if the path doesn't exist or loading of the library fails. func (lm *LibrariesManager) LoadLibraryFromDir(libRootDir *paths.Path, location libraries.LibraryLocation) error { if libRootDir.NotExist() { - return fmt.Errorf("library path does not exist: %s", libRootDir) + return fmt.Errorf(tr("library path does not exist: %s"), libRootDir) } library, err := libraries.Load(libRootDir, location) if err != nil { - return fmt.Errorf("loading library from %s: %s", libRootDir, err) + return fmt.Errorf(tr("loading library from %[1]s: %[2]s"), libRootDir, err) } alternatives, ok := lm.Libraries[library.Name] diff --git a/arduino/libraries/librariesresolver/cpp.go b/arduino/libraries/librariesresolver/cpp.go index c762aba55de..94d8b82bf05 100644 --- a/arduino/libraries/librariesresolver/cpp.go +++ b/arduino/libraries/librariesresolver/cpp.go @@ -23,6 +23,7 @@ import ( "github.com/arduino/arduino-cli/arduino/libraries" "github.com/arduino/arduino-cli/arduino/libraries/librariesmanager" "github.com/arduino/arduino-cli/arduino/utils" + "github.com/arduino/arduino-cli/i18n" "github.com/schollz/closestmatch" "github.com/sirupsen/logrus" ) @@ -32,6 +33,8 @@ type Cpp struct { headers map[string]libraries.List } +var tr = i18n.Tr + // NewCppResolver creates a new Cpp resolver func NewCppResolver() *Cpp { return &Cpp{ @@ -54,7 +57,7 @@ func (resolver *Cpp) ScanFromLibrariesManager(lm *librariesmanager.LibrariesMana func (resolver *Cpp) ScanLibrary(lib *libraries.Library) error { cppHeaders, err := lib.SourceHeaders() if err != nil { - return fmt.Errorf("reading lib headers: %s", err) + return fmt.Errorf(tr("reading lib headers: %s"), err) } for _, cppHeader := range cppHeaders { l := resolver.headers[cppHeader] diff --git a/arduino/libraries/loader.go b/arduino/libraries/loader.go index 482ff39a78c..5a26efc9dab 100644 --- a/arduino/libraries/loader.go +++ b/arduino/libraries/loader.go @@ -44,7 +44,7 @@ func addUtilityDirectory(library *Library) { func makeNewLibrary(libraryDir *paths.Path, location LibraryLocation) (*Library, error) { libProperties, err := properties.Load(libraryDir.Join("library.properties").String()) if err != nil { - return nil, fmt.Errorf("loading library.properties: %s", err) + return nil, fmt.Errorf(tr("loading library.properties: %s"), err) } if libProperties.Get("maintainer") == "" && libProperties.Get("email") != "" { @@ -106,7 +106,7 @@ func makeNewLibrary(libraryDir *paths.Path, location LibraryLocation) (*Library, } if err := addExamples(library); err != nil { - return nil, errors.Errorf("scanning examples: %s", err) + return nil, errors.Errorf(tr("scanning examples: %s"), err) } library.Name = libraryDir.Base() library.RealName = strings.TrimSpace(libProperties.Get("name")) @@ -137,7 +137,7 @@ func makeLegacyLibrary(path *paths.Path, location LibraryLocation) (*Library, er Version: semver.MustParse(""), } if err := addExamples(library); err != nil { - return nil, errors.Errorf("scanning examples: %s", err) + return nil, errors.Errorf(tr("scanning examples: %s"), err) } addUtilityDirectory(library) return library, nil diff --git a/arduino/monitors/serial.go b/arduino/monitors/serial.go index 531abdbd873..95df6eba21f 100644 --- a/arduino/monitors/serial.go +++ b/arduino/monitors/serial.go @@ -16,6 +16,7 @@ package monitors import ( + "github.com/arduino/arduino-cli/i18n" "github.com/pkg/errors" "go.bug.st/serial" ) @@ -24,6 +25,8 @@ const ( defaultBaudRate = 9600 ) +var tr = i18n.Tr + // SerialMonitor is a monitor for serial ports type SerialMonitor struct { port serial.Port @@ -38,7 +41,7 @@ func OpenSerialMonitor(portName string, baudRate int) (*SerialMonitor, error) { port, err := serial.Open(portName, &serial.Mode{BaudRate: baudRate}) if err != nil { - return nil, errors.Wrap(err, "error opening serial monitor") + return nil, errors.Wrap(err, tr("error opening serial monitor")) } return &SerialMonitor{ diff --git a/arduino/resources/checksums.go b/arduino/resources/checksums.go index f96e17658a4..1620999882f 100644 --- a/arduino/resources/checksums.go +++ b/arduino/resources/checksums.go @@ -29,21 +29,24 @@ import ( "path/filepath" "strings" + "github.com/arduino/arduino-cli/i18n" paths "github.com/arduino/go-paths-helper" ) +var tr = i18n.Tr + // TestLocalArchiveChecksum test if the checksum of the local archive match the checksum of the DownloadResource func (r *DownloadResource) TestLocalArchiveChecksum(downloadDir *paths.Path) (bool, error) { if r.Checksum == "" { - return false, fmt.Errorf("missing checksum for: %s", r.ArchiveFileName) + return false, fmt.Errorf(tr("missing checksum for: %s"), r.ArchiveFileName) } split := strings.SplitN(r.Checksum, ":", 2) if len(split) != 2 { - return false, fmt.Errorf("invalid checksum format: %s", r.Checksum) + return false, fmt.Errorf(tr("invalid checksum format: %s"), r.Checksum) } digest, err := hex.DecodeString(split[1]) if err != nil { - return false, fmt.Errorf("invalid hash '%s': %s", split[1], err) + return false, fmt.Errorf(tr("invalid hash '%[1]s': %[2]s"), split[1], err) } // names based on: https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#MessageDigest @@ -56,25 +59,25 @@ func (r *DownloadResource) TestLocalArchiveChecksum(downloadDir *paths.Path) (bo case "MD5": algo = crypto.MD5.New() default: - return false, fmt.Errorf("unsupported hash algorithm: %s", split[0]) + return false, fmt.Errorf(tr("unsupported hash algorithm: %s"), split[0]) } filePath, err := r.ArchivePath(downloadDir) if err != nil { - return false, fmt.Errorf("getting archive path: %s", err) + return false, fmt.Errorf(tr("getting archive path: %s"), err) } file, err := os.Open(filePath.String()) if err != nil { - return false, fmt.Errorf("opening archive file: %s", err) + return false, fmt.Errorf(tr("opening archive file: %s"), err) } defer file.Close() if _, err := io.Copy(algo, file); err != nil { - return false, fmt.Errorf("computing hash: %s", err) + return false, fmt.Errorf(tr("computing hash: %s"), err) } if bytes.Compare(algo.Sum(nil), digest) != 0 { - return false, fmt.Errorf("archive hash differs from hash in index") + return false, fmt.Errorf(tr("archive hash differs from hash in index")) } return true, nil @@ -84,14 +87,14 @@ func (r *DownloadResource) TestLocalArchiveChecksum(downloadDir *paths.Path) (bo func (r *DownloadResource) TestLocalArchiveSize(downloadDir *paths.Path) (bool, error) { filePath, err := r.ArchivePath(downloadDir) if err != nil { - return false, fmt.Errorf("getting archive path: %s", err) + return false, fmt.Errorf(tr("getting archive path: %s"), err) } info, err := filePath.Stat() if err != nil { - return false, fmt.Errorf("getting archive info: %s", err) + return false, fmt.Errorf(tr("getting archive info: %s"), err) } if info.Size() != r.Size { - return false, fmt.Errorf("fetched archive size differs from size specified in index") + return false, fmt.Errorf(tr("fetched archive size differs from size specified in index")) } return true, nil @@ -100,20 +103,20 @@ func (r *DownloadResource) TestLocalArchiveSize(downloadDir *paths.Path) (bool, // TestLocalArchiveIntegrity checks for integrity of the local archive. func (r *DownloadResource) TestLocalArchiveIntegrity(downloadDir *paths.Path) (bool, error) { if cached, err := r.IsCached(downloadDir); err != nil { - return false, fmt.Errorf("testing if archive is cached: %s", err) + return false, fmt.Errorf(tr("testing if archive is cached: %s"), err) } else if !cached { return false, nil } if ok, err := r.TestLocalArchiveSize(downloadDir); err != nil { - return false, fmt.Errorf("testing archive size: %s", err) + return false, fmt.Errorf(tr("testing archive size: %s"), err) } else if !ok { return false, nil } ok, err := r.TestLocalArchiveChecksum(downloadDir) if err != nil { - return false, fmt.Errorf("testing archive checksum: %s", err) + return false, fmt.Errorf(tr("testing archive checksum: %s"), err) } return ok, nil } @@ -139,7 +142,7 @@ func computeDirChecksum(root string) (string, error) { } defer f.Close() if _, err := io.Copy(hash, f); err != nil { - return fmt.Errorf("failed to compute hash of file \"%s\"", info.Name()) + return fmt.Errorf(tr("failed to compute hash of file \"%s\""), info.Name()) } return nil }) @@ -176,7 +179,7 @@ func CheckDirChecksum(root string) (bool, error) { return false, err } if file.Checksum != checksum { - return false, fmt.Errorf("Checksum differs from checksum in package.json") + return false, fmt.Errorf(tr("Checksum differs from checksum in package.json")) } return true, nil diff --git a/arduino/resources/helpers.go b/arduino/resources/helpers.go index 3b7937849ba..b1c56d0f678 100644 --- a/arduino/resources/helpers.go +++ b/arduino/resources/helpers.go @@ -37,7 +37,7 @@ func (r *DownloadResource) ArchivePath(downloadDir *paths.Path) (*paths.Path, er func (r *DownloadResource) IsCached(downloadDir *paths.Path) (bool, error) { archivePath, err := r.ArchivePath(downloadDir) if err != nil { - return false, fmt.Errorf("getting archive path: %s", err) + return false, fmt.Errorf(tr("getting archive path: %s"), err) } return archivePath.Exist(), nil } @@ -46,7 +46,7 @@ func (r *DownloadResource) IsCached(downloadDir *paths.Path) (bool, error) { func (r *DownloadResource) Download(downloadDir *paths.Path, config *downloader.Config) (*downloader.Downloader, error) { path, err := r.ArchivePath(downloadDir) if err != nil { - return nil, fmt.Errorf("getting archive path: %s", err) + return nil, fmt.Errorf(tr("getting archive path: %s"), err) } if _, err := path.Stat(); os.IsNotExist(err) { @@ -56,7 +56,7 @@ func (r *DownloadResource) Download(downloadDir *paths.Path, config *downloader. ok, err := r.TestLocalArchiveIntegrity(downloadDir) if err != nil || !ok { if err := path.Remove(); err != nil { - return nil, fmt.Errorf("removing corrupted archive file: %s", err) + return nil, fmt.Errorf(tr("removing corrupted archive file: %s"), err) } } else { // File is cached, nothing to do here @@ -65,7 +65,7 @@ func (r *DownloadResource) Download(downloadDir *paths.Path, config *downloader. } else if err == nil { // resume download } else { - return nil, fmt.Errorf("getting archive file info: %s", err) + return nil, fmt.Errorf(tr("getting archive file info: %s"), err) } return downloader.DownloadWithConfig(path.String(), r.URL, *config) diff --git a/arduino/resources/install.go b/arduino/resources/install.go index d87708b7dd1..cb2043aa1c7 100644 --- a/arduino/resources/install.go +++ b/arduino/resources/install.go @@ -34,29 +34,29 @@ import ( func (release *DownloadResource) Install(downloadDir, tempPath, destDir *paths.Path) error { // Check the integrity of the package if ok, err := release.TestLocalArchiveIntegrity(downloadDir); err != nil { - return fmt.Errorf("testing local archive integrity: %s", err) + return fmt.Errorf(tr("testing local archive integrity: %s"), err) } else if !ok { - return fmt.Errorf("checking local archive integrity") + return fmt.Errorf(tr("checking local archive integrity")) } // Create a temporary dir to extract package if err := tempPath.MkdirAll(); err != nil { - return fmt.Errorf("creating temp dir for extraction: %s", err) + return fmt.Errorf(tr("creating temp dir for extraction: %s"), err) } tempDir, err := tempPath.MkTempDir("package-") if err != nil { - return fmt.Errorf("creating temp dir for extraction: %s", err) + return fmt.Errorf(tr("creating temp dir for extraction: %s"), err) } defer tempDir.RemoveAll() // Obtain the archive path and open it archivePath, err := release.ArchivePath(downloadDir) if err != nil { - return fmt.Errorf("getting archive path: %s", err) + return fmt.Errorf(tr("getting archive path: %s"), err) } file, err := os.Open(archivePath.String()) if err != nil { - return fmt.Errorf("opening archive file: %s", err) + return fmt.Errorf(tr("opening archive file: %s"), err) } defer file.Close() @@ -64,13 +64,13 @@ func (release *DownloadResource) Install(downloadDir, tempPath, destDir *paths.P ctx, cancel := cleanup.InterruptableContext(context.Background()) defer cancel() if err := extract.Archive(ctx, file, tempDir.String(), nil); err != nil { - return fmt.Errorf("extracting archive: %s", err) + return fmt.Errorf(tr("extracting archive: %s"), err) } // Check package content and find package root dir root, err := findPackageRoot(tempDir) if err != nil { - return fmt.Errorf("searching package root dir: %s", err) + return fmt.Errorf(tr("searching package root dir: %s"), err) } // Ensure container dir exists @@ -91,7 +91,7 @@ func (release *DownloadResource) Install(downloadDir, tempPath, destDir *paths.P // Move/rename the extracted root directory in the destination directory if err := root.Rename(destDir); err != nil { - return fmt.Errorf("moving extracted archive to destination dir: %s", err) + return fmt.Errorf(tr("moving extracted archive to destination dir: %s"), err) } // TODO @@ -115,7 +115,7 @@ func IsDirEmpty(path *paths.Path) (bool, error) { func findPackageRoot(parent *paths.Path) (*paths.Path, error) { files, err := parent.ReadDir() if err != nil { - return nil, fmt.Errorf("reading package root dir: %s", err) + return nil, fmt.Errorf(tr("reading package root dir: %s"), err) } var root *paths.Path for _, file := range files { @@ -125,11 +125,11 @@ func findPackageRoot(parent *paths.Path) (*paths.Path, error) { if root == nil { root = file } else { - return nil, fmt.Errorf("no unique root dir in archive, found '%s' and '%s'", root, file) + return nil, fmt.Errorf(tr("no unique root dir in archive, found '%[1]s' and '%[2]s'"), root, file) } } if root == nil { - return nil, fmt.Errorf("files in archive must be placed in a subdirectory") + return nil, fmt.Errorf(tr("files in archive must be placed in a subdirectory")) } return root, nil } diff --git a/arduino/security/signatures.go b/arduino/security/signatures.go index 21f32fbd5f8..22db3e1e920 100644 --- a/arduino/security/signatures.go +++ b/arduino/security/signatures.go @@ -20,11 +20,14 @@ import ( "io" "os" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/go-paths-helper" rice "github.com/cmaglie/go.rice" "golang.org/x/crypto/openpgp" ) +var tr = i18n.Tr + // VerifyArduinoDetachedSignature checks that the detached GPG signature (in the // signaturePath file) matches the given targetPath file and is an authentic // signature from the bundled trusted keychain. If any of the above conditions @@ -66,16 +69,16 @@ func VerifyDetachedSignature(targetPath *paths.Path, signaturePath *paths.Path, func VerifySignature(targetPath *paths.Path, signaturePath *paths.Path, arduinoKeyringFile io.Reader) (bool, *openpgp.Entity, error) { keyRing, err := openpgp.ReadKeyRing(arduinoKeyringFile) if err != nil { - return false, nil, fmt.Errorf("retrieving Arduino public keys: %s", err) + return false, nil, fmt.Errorf(tr("retrieving Arduino public keys: %s"), err) } target, err := targetPath.Open() if err != nil { - return false, nil, fmt.Errorf("opening target file: %s", err) + return false, nil, fmt.Errorf(tr("opening target file: %s"), err) } defer target.Close() signature, err := signaturePath.Open() if err != nil { - return false, nil, fmt.Errorf("opening signature file: %s", err) + return false, nil, fmt.Errorf(tr("opening signature file: %s"), err) } defer signature.Close() signer, err := openpgp.CheckDetachedSignature(keyRing, target, signature) diff --git a/arduino/serialutils/serialutils.go b/arduino/serialutils/serialutils.go index 17131cecdf6..e4293035532 100644 --- a/arduino/serialutils/serialutils.go +++ b/arduino/serialutils/serialutils.go @@ -20,10 +20,13 @@ import ( "strings" "time" + "github.com/arduino/arduino-cli/i18n" "github.com/pkg/errors" "go.bug.st/serial" ) +var tr = i18n.Tr + // TouchSerialPortAt1200bps open and close the serial port at 1200 bps. This // is used on many Arduino boards as a signal to put the board in "bootloader" // mode. @@ -31,13 +34,13 @@ func TouchSerialPortAt1200bps(port string) error { // Open port p, err := serial.Open(port, &serial.Mode{BaudRate: 1200}) if err != nil { - return errors.WithMessage(err, "opening port at 1200bps") + return errors.WithMessage(err, tr("opening port at 1200bps")) } // Set DTR to false if err = p.SetDTR(false); err != nil { p.Close() - return errors.WithMessage(err, "setting DTR to OFF") + return errors.WithMessage(err, tr("setting DTR to OFF")) } // Close serial port @@ -55,7 +58,7 @@ func TouchSerialPortAt1200bps(port string) error { func getPortMap() (map[string]bool, error) { ports, err := serial.GetPortsList() if err != nil { - return nil, errors.WithMessage(err, "listing serial ports") + return nil, errors.WithMessage(err, tr("listing serial ports")) } res := map[string]bool{} for _, port := range ports { @@ -127,7 +130,8 @@ func Reset(portToTouch string, wait bool, cb *ResetProgressCallbacks, dryRun boo // do nothing! } else { if err := TouchSerialPortAt1200bps(portToTouch); err != nil { - fmt.Println("TOUCH: error during reset:", err) + fmt.Printf(tr("TOUCH: error during reset: %s"), err) + fmt.Println() } } } diff --git a/arduino/sketch/sketch.go b/arduino/sketch/sketch.go index f231402799c..adb41d82fe0 100644 --- a/arduino/sketch/sketch.go +++ b/arduino/sketch/sketch.go @@ -24,6 +24,7 @@ import ( "strings" "github.com/arduino/arduino-cli/arduino/globals" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/go-paths-helper" "github.com/pkg/errors" ) @@ -52,6 +53,8 @@ type BoardMetadata struct { Port string `json:"port,omitepty"` } +var tr = i18n.Tr + // New creates an Sketch instance by reading all the files composing a sketch and grouping them // by file type. func New(path *paths.Path) (*Sketch, error) { @@ -67,7 +70,7 @@ func New(path *paths.Path) (*Sketch, error) { if mainFile == nil { mainFile = candidateSketchMainFile } else { - return nil, errors.Errorf("multiple main sketch files found (%v, %v)", + return nil, errors.Errorf(tr("multiple main sketch files found (%[1]v, %[2]v)"), mainFile, candidateSketchMainFile, ) @@ -94,7 +97,7 @@ func New(path *paths.Path) (*Sketch, error) { } if mainFile == nil { - return nil, fmt.Errorf("can't find main Sketch file in %s", path) + return nil, fmt.Errorf(tr("can't find main Sketch file in %s"), path) } sketchFolderFiles, err := sketch.supportedFiles() @@ -135,7 +138,7 @@ func New(path *paths.Path) (*Sketch, error) { sketch.RootFolderFiles.Add(p) } } else { - return nil, errors.Errorf("unknown sketch file extension '%s'", ext) + return nil, errors.Errorf(tr("unknown sketch file extension '%s'"), ext) } } @@ -144,7 +147,7 @@ func New(path *paths.Path) (*Sketch, error) { sort.Sort(&sketch.RootFolderFiles) if err := sketch.importMetadata(); err != nil { - return nil, fmt.Errorf("importing sketch metadata: %s", err) + return nil, fmt.Errorf(tr("importing sketch metadata: %s"), err) } return sketch, nil } @@ -181,7 +184,7 @@ func (s *Sketch) importMetadata() error { content, err := sketchJSON.ReadFile() if err != nil { - return fmt.Errorf("reading sketch metadata %s: %s", sketchJSON, err) + return fmt.Errorf(tr("reading sketch metadata %[1]s: %[2]s"), sketchJSON, err) } var meta Metadata err = json.Unmarshal(content, &meta) @@ -189,7 +192,7 @@ func (s *Sketch) importMetadata() error { if s.Metadata == nil { s.Metadata = new(Metadata) } - return fmt.Errorf("encoding sketch metadata: %s", err) + return fmt.Errorf(tr("encoding sketch metadata: %s"), err) } s.Metadata = &meta return nil @@ -200,12 +203,12 @@ func (s *Sketch) importMetadata() error { func (s *Sketch) ExportMetadata() error { d, err := json.MarshalIndent(&s.Metadata, "", " ") if err != nil { - return fmt.Errorf("decoding sketch metadata: %s", err) + return fmt.Errorf(tr("decoding sketch metadata: %s"), err) } sketchJSON := s.FullPath.Join("sketch.json") if err := sketchJSON.WriteFile(d); err != nil { - return fmt.Errorf("writing sketch metadata %s: %s", sketchJSON, err) + return fmt.Errorf(tr("writing sketch metadata %[1]s: %[2]s"), sketchJSON, err) } return nil } @@ -222,7 +225,7 @@ func (s *Sketch) ExportMetadata() error { func (s *Sketch) checkSketchCasing() error { files, err := s.FullPath.ReadDir() if err != nil { - return errors.Errorf("reading files: %v", err) + return errors.Errorf(tr("reading files: %v"), err) } files.FilterOutDirs() @@ -252,7 +255,7 @@ type InvalidSketchFolderNameError struct { } func (e *InvalidSketchFolderNameError) Error() string { - return fmt.Sprintf("no valid sketch found in %s: missing %s", e.SketchFolder, e.SketchFile) + return fmt.Sprintf(tr("no valid sketch found in %[1]s: missing %[2]s"), e.SketchFolder, e.SketchFile) } // CheckForPdeFiles returns all files ending with .pde extension diff --git a/cli/board/attach.go b/cli/board/attach.go index bde7b975911..c907e9448a5 100644 --- a/cli/board/attach.go +++ b/cli/board/attach.go @@ -17,6 +17,7 @@ package board import ( "context" + "fmt" "os" "github.com/arduino/arduino-cli/cli/errorcodes" @@ -32,9 +33,9 @@ import ( func initAttachCommand() *cobra.Command { attachCommand := &cobra.Command{ - Use: "attach | [sketchPath]", - Short: "Attaches a sketch to a board.", - Long: "Attaches a sketch to a board.", + Use: fmt.Sprintf("attach <%s>|<%s> [%s]", tr("port"), tr("FQBN"), tr("sketchPath")), + Short: tr("Attaches a sketch to a board."), + Long: tr("Attaches a sketch to a board."), Example: " " + os.Args[0] + " board attach serial:///dev/ttyACM0\n" + " " + os.Args[0] + " board attach serial:///dev/ttyACM0 HelloWorld\n" + " " + os.Args[0] + " board attach arduino:samd:mkr1000", @@ -42,7 +43,7 @@ func initAttachCommand() *cobra.Command { Run: runAttachCommand, } attachCommand.Flags().StringVar(&attachFlags.searchTimeout, "timeout", "5s", - "The connected devices search timeout, raise it if your board doesn't show up (e.g. to 10s).") + fmt.Sprintf(tr("The connected devices search timeout, raise it if your board doesn't show up (e.g. to %s)."), "10s")) return attachCommand } @@ -66,7 +67,7 @@ func runAttachCommand(cmd *cobra.Command, args []string) { SketchPath: path.String(), SearchTimeout: attachFlags.searchTimeout, }, output.TaskProgress()); err != nil { - feedback.Errorf("Attach board error: %v", err) + feedback.Errorf(tr("Attach board error: %v"), err) os.Exit(errorcodes.ErrGeneric) } } @@ -79,7 +80,7 @@ func initSketchPath(sketchPath *paths.Path) *paths.Path { wd, err := paths.Getwd() if err != nil { - feedback.Errorf("Couldn't get current working directory: %v", err) + feedback.Errorf(tr("Couldn't get current working directory: %v"), err) os.Exit(errorcodes.ErrGeneric) } logrus.Infof("Reading sketch from dir: %s", wd) diff --git a/cli/board/board.go b/cli/board/board.go index 45c6907105c..d1dbb9add35 100644 --- a/cli/board/board.go +++ b/cli/board/board.go @@ -25,11 +25,11 @@ import ( func NewCommand() *cobra.Command { boardCommand := &cobra.Command{ Use: "board", - Short: "Arduino board commands.", - Long: "Arduino board commands.", - Example: " # Lists all connected boards.\n" + + Short: tr("Arduino board commands."), + Long: tr("Arduino board commands."), + Example: " # " + tr("Lists all connected boards.") + "\n" + " " + os.Args[0] + " board list\n\n" + - " # Attaches a sketch to a board.\n" + + " # " + tr("Attaches a sketch to a board.") + "\n" + " " + os.Args[0] + " board attach serial:///dev/ttyACM0 mySketch", } diff --git a/cli/board/details.go b/cli/board/details.go index 0ff0f4cb392..87f9b975e4f 100644 --- a/cli/board/details.go +++ b/cli/board/details.go @@ -38,7 +38,7 @@ var listProgrammers bool func initDetailsCommand() *cobra.Command { var detailsCommand = &cobra.Command{ - Use: "details -b ", + Use: fmt.Sprintf("details -b <%s>", tr("FQBN")), Short: tr("Print details about a board."), Long: tr("Show information about a board, in particular if the board has options to be specified in the FQBN."), Example: " " + os.Args[0] + " board details -b arduino:avr:nano", @@ -47,7 +47,7 @@ func initDetailsCommand() *cobra.Command { } detailsCommand.Flags().BoolVarP(&showFullDetails, "full", "f", false, tr("Show full board details")) - detailsCommand.Flags().StringVarP(&fqbn, "fqbn", "b", "", "Fully Qualified Board Name, e.g.: arduino:avr:uno") + detailsCommand.Flags().StringVarP(&fqbn, "fqbn", "b", "", tr("Fully Qualified Board Name, e.g.: arduino:avr:uno")) detailsCommand.Flags().BoolVarP(&listProgrammers, "list-programmers", "", false, tr("Show list of available programmers")) // detailsCommand.MarkFlagRequired("fqbn") // enable once `board details ` is removed @@ -118,7 +118,7 @@ func (dr detailsResult) String() string { t.SetColumnWidthMode(1, table.Average) t.AddRow(tr("Board name:"), details.Name) - t.AddRow("FQBN:", details.Fqbn) + t.AddRow(tr("FQBN:"), details.Fqbn) addIfNotEmpty(tr("Board version:"), details.Version) if details.GetDebuggingSupported() { t.AddRow(tr("Debugging supported:"), table.NewCell("✔", color.New(color.FgGreen))) @@ -166,7 +166,7 @@ func (dr detailsResult) String() string { t.AddRow("", tr("File:"), sys.ArchiveFilename) t.AddRow("", tr("Size (bytes):"), fmt.Sprint(sys.Size)) t.AddRow("", tr("Checksum:"), sys.Checksum) - t.AddRow("", "URL:", sys.Url) + t.AddRow("", tr("URL:"), sys.Url) t.AddRow() // get some space from above } } diff --git a/cli/board/list.go b/cli/board/list.go index 02623bb6127..a95729453e6 100644 --- a/cli/board/list.go +++ b/cli/board/list.go @@ -34,17 +34,17 @@ import ( func initListCommand() *cobra.Command { listCommand := &cobra.Command{ Use: "list", - Short: "List connected boards.", - Long: "Detects and displays a list of boards connected to the current computer.", + Short: tr("List connected boards."), + Long: tr("Detects and displays a list of boards connected to the current computer."), Example: " " + os.Args[0] + " board list --timeout 10s", Args: cobra.NoArgs, Run: runListCommand, } listCommand.Flags().StringVar(&listFlags.timeout, "timeout", "0s", - "The connected devices search timeout, raise it if your board doesn't show up (e.g. to 10s).") + fmt.Sprintf(tr("The connected devices search timeout, raise it if your board doesn't show up (e.g. to %s)."), "10s")) listCommand.Flags().BoolVarP(&listFlags.watch, "watch", "w", false, - "Command keeps running and prints list of connected boards whenever there is a change.") + tr("Command keeps running and prints list of connected boards whenever there is a change.")) return listCommand } @@ -63,7 +63,7 @@ func runListCommand(cmd *cobra.Command, args []string) { } if timeout, err := time.ParseDuration(listFlags.timeout); err != nil { - feedback.Errorf("Invalid timeout: %v", err) + feedback.Errorf(tr("Invalid timeout: %v"), err) os.Exit(errorcodes.ErrBadArgument) } else { time.Sleep(timeout) @@ -72,7 +72,7 @@ func runListCommand(cmd *cobra.Command, args []string) { inst := instance.CreateAndInit() ports, err := board.List(inst.GetId()) if err != nil { - feedback.Errorf("Error detecting boards: %v", err) + feedback.Errorf(tr("Error detecting boards: %v"), err) os.Exit(errorcodes.ErrNetwork) } @@ -82,14 +82,14 @@ func runListCommand(cmd *cobra.Command, args []string) { func watchList(cmd *cobra.Command, inst *rpc.Instance) { eventsChan, err := board.Watch(inst.Id, nil) if err != nil { - feedback.Errorf("Error detecting boards: %v", err) + feedback.Errorf(tr("Error detecting boards: %v"), err) os.Exit(errorcodes.ErrNetwork) } // This is done to avoid printing the header each time a new event is received if feedback.GetFormat() == feedback.Text { t := table.New() - t.SetHeader("Port", "Type", "Event", "Board Name", "FQBN", "Core") + t.SetHeader(tr("Port"), tr("Type"), tr("Event"), tr("Board Name"), tr("FQBN"), tr("Core")) feedback.Print(t.Render()) } @@ -118,7 +118,7 @@ func (dr result) Data() interface{} { func (dr result) String() string { if len(dr.ports) == 0 { - return "No boards found." + return tr("No boards found.") } sort.Slice(dr.ports, func(i, j int) bool { @@ -128,7 +128,7 @@ func (dr result) String() string { }) t := table.New() - t.SetHeader("Port", "Type", "Board Name", "FQBN", "Core") + t.SetHeader(tr("Port"), tr("Type"), tr("Board Name"), tr("FQBN"), tr("Core")) for _, port := range dr.ports { address := port.GetProtocol() + "://" + port.GetAddress() if port.GetProtocol() == "serial" { @@ -158,7 +158,7 @@ func (dr result) String() string { protocol = "" } } else { - board := "Unknown" + board := tr("Unknown") fqbn := "" coreName := "" t.AddRow(address, protocol, board, fqbn, coreName) @@ -185,8 +185,8 @@ func (dr watchEvent) String() string { t := table.New() event := map[string]string{ - "add": "Connected", - "remove": "Disconnected", + "add": tr("Connected"), + "remove": tr("Disconnected"), }[dr.Type] address := fmt.Sprintf("%s://%s", dr.Protocol, dr.Address) diff --git a/cli/board/listall.go b/cli/board/listall.go index e21e03e1f80..4093abd8642 100644 --- a/cli/board/listall.go +++ b/cli/board/listall.go @@ -17,6 +17,7 @@ package board import ( "context" + "fmt" "os" "sort" @@ -31,18 +32,17 @@ import ( func initListAllCommand() *cobra.Command { var listAllCommand = &cobra.Command{ - Use: "listall [boardname]", - Short: "List all known boards and their corresponding FQBN.", - Long: "" + - "List all boards that have the support platform installed. You can search\n" + - "for a specific board if you specify the board name", + Use: fmt.Sprintf("listall [%s]", tr("boardname")), + Short: tr("List all known boards and their corresponding FQBN."), + Long: tr(`List all boards that have the support platform installed. You can search +for a specific board if you specify the board name`), Example: "" + " " + os.Args[0] + " board listall\n" + " " + os.Args[0] + " board listall zero", Args: cobra.ArbitraryArgs, Run: runListAllCommand, } - listAllCommand.Flags().BoolVarP(&showHiddenBoard, "show-hidden", "a", false, "Show also boards marked as 'hidden' in the platform") + listAllCommand.Flags().BoolVarP(&showHiddenBoard, "show-hidden", "a", false, tr("Show also boards marked as 'hidden' in the platform")) return listAllCommand } @@ -58,7 +58,7 @@ func runListAllCommand(cmd *cobra.Command, args []string) { IncludeHiddenBoards: showHiddenBoard, }) if err != nil { - feedback.Errorf("Error listing boards: %v", err) + feedback.Errorf(tr("Error listing boards: %v"), err) os.Exit(errorcodes.ErrGeneric) } @@ -81,11 +81,11 @@ func (dr resultAll) String() string { }) t := table.New() - t.SetHeader("Board Name", "FQBN", "") + t.SetHeader(tr("Board Name"), tr("FQBN"), "") for _, item := range dr.list.GetBoards() { hidden := "" if item.IsHidden { - hidden = "(hidden)" + hidden = tr("(hidden)") } t.AddRow(item.GetName(), item.GetFqbn(), hidden) } diff --git a/cli/board/search.go b/cli/board/search.go index 67db7b22110..b6768ab8020 100644 --- a/cli/board/search.go +++ b/cli/board/search.go @@ -17,6 +17,7 @@ package board import ( "context" + "fmt" "os" "sort" "strings" @@ -32,18 +33,17 @@ import ( func initSearchCommand() *cobra.Command { var searchCommand = &cobra.Command{ - Use: "search [boardname]", - Short: "List all known boards and their corresponding FQBN.", - Long: "" + - "List all boards that have the support platform installed. You can search\n" + - "for a specific board if you specify the board name", + Use: fmt.Sprintf("search [%s]", tr("boardname")), + Short: tr("List all known boards and their corresponding FQBN."), + Long: tr(`List all boards that have the support platform installed. You can search +for a specific board if you specify the board name`), Example: "" + " " + os.Args[0] + " board search\n" + " " + os.Args[0] + " board search zero", Args: cobra.ArbitraryArgs, Run: runSearchCommand, } - searchCommand.Flags().BoolVarP(&searchFlags.showHiddenBoard, "show-hidden", "a", false, "Show also boards marked as 'hidden' in the platform") + searchCommand.Flags().BoolVarP(&searchFlags.showHiddenBoard, "show-hidden", "a", false, tr("Show also boards marked as 'hidden' in the platform")) return searchCommand } @@ -60,7 +60,7 @@ func runSearchCommand(cmd *cobra.Command, args []string) { IncludeHiddenBoards: searchFlags.showHiddenBoard, }) if err != nil { - feedback.Errorf("Error searching boards: %v", err) + feedback.Errorf(tr("Error searching boards: %v"), err) os.Exit(errorcodes.ErrGeneric) } @@ -83,11 +83,11 @@ func (r searchResults) String() string { }) t := table.New() - t.SetHeader("Board Name", "FQBN", "Platform ID", "") + t.SetHeader(tr("Board Name"), tr("FQBN"), tr("Platform ID"), "") for _, item := range r.boards { hidden := "" if item.IsHidden { - hidden = "(hidden)" + hidden = tr("(hidden)") } t.AddRow(item.GetName(), item.GetFqbn(), item.Platform.Id, hidden) } diff --git a/cli/burnbootloader/burnbootloader.go b/cli/burnbootloader/burnbootloader.go index e2b8a21374c..b0db88efe1e 100644 --- a/cli/burnbootloader/burnbootloader.go +++ b/cli/burnbootloader/burnbootloader.go @@ -23,6 +23,7 @@ import ( "github.com/arduino/arduino-cli/cli/feedback" "github.com/arduino/arduino-cli/cli/instance" "github.com/arduino/arduino-cli/commands/upload" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/spf13/cobra" ) @@ -34,25 +35,26 @@ var ( verify bool programmer string dryRun bool + tr = i18n.Tr ) // NewCommand created a new `burn-bootloader` command func NewCommand() *cobra.Command { burnBootloaderCommand := &cobra.Command{ Use: "burn-bootloader", - Short: "Upload the bootloader.", - Long: "Upload the bootloader on the board using an external programmer.", + Short: tr("Upload the bootloader."), + Long: tr("Upload the bootloader on the board using an external programmer."), Example: " " + os.Args[0] + " burn-bootloader -b arduino:avr:uno -P atmel_ice", Args: cobra.MaximumNArgs(1), Run: run, } - burnBootloaderCommand.Flags().StringVarP(&fqbn, "fqbn", "b", "", "Fully Qualified Board Name, e.g.: arduino:avr:uno") - burnBootloaderCommand.Flags().StringVarP(&port, "port", "p", "", "Upload port, e.g.: COM10 or /dev/ttyACM0") - burnBootloaderCommand.Flags().BoolVarP(&verify, "verify", "t", false, "Verify uploaded binary after the upload.") - burnBootloaderCommand.Flags().BoolVarP(&verbose, "verbose", "v", false, "Turns on verbose mode.") - burnBootloaderCommand.Flags().StringVarP(&programmer, "programmer", "P", "", "Use the specified programmer to upload.") - burnBootloaderCommand.Flags().BoolVar(&dryRun, "dry-run", false, "Do not perform the actual upload, just log out actions") + burnBootloaderCommand.Flags().StringVarP(&fqbn, "fqbn", "b", "", tr("Fully Qualified Board Name, e.g.: arduino:avr:uno")) + burnBootloaderCommand.Flags().StringVarP(&port, "port", "p", "", tr("Upload port, e.g.: COM10 or /dev/ttyACM0")) + burnBootloaderCommand.Flags().BoolVarP(&verify, "verify", "t", false, tr("Verify uploaded binary after the upload.")) + burnBootloaderCommand.Flags().BoolVarP(&verbose, "verbose", "v", false, tr("Turns on verbose mode.")) + burnBootloaderCommand.Flags().StringVarP(&programmer, "programmer", "P", "", tr("Use the specified programmer to upload.")) + burnBootloaderCommand.Flags().BoolVar(&dryRun, "dry-run", false, tr("Do not perform the actual upload, just log out actions")) burnBootloaderCommand.Flags().MarkHidden("dry-run") return burnBootloaderCommand @@ -70,7 +72,7 @@ func run(command *cobra.Command, args []string) { Programmer: programmer, DryRun: dryRun, }, os.Stdout, os.Stderr); err != nil { - feedback.Errorf("Error during Upload: %v", err) + feedback.Errorf(tr("Error during Upload: %v"), err) os.Exit(errorcodes.ErrGeneric) } os.Exit(0) diff --git a/cli/cache/cache.go b/cli/cache/cache.go index cb544aed6ca..1d8394f03bc 100644 --- a/cli/cache/cache.go +++ b/cli/cache/cache.go @@ -18,16 +18,19 @@ package cache import ( "os" + "github.com/arduino/arduino-cli/i18n" "github.com/spf13/cobra" ) +var tr = i18n.Tr + // NewCommand created a new `cache` command func NewCommand() *cobra.Command { cacheCommand := &cobra.Command{ Use: "cache", - Short: "Arduino cache commands.", - Long: "Arduino cache commands.", - Example: "# Clean caches.\n" + + Short: tr("Arduino cache commands."), + Long: tr("Arduino cache commands."), + Example: "# " + tr("Clean caches.") + "\n" + " " + os.Args[0] + " cache clean\n\n", } diff --git a/cli/cache/clean.go b/cli/cache/clean.go index 5603e72aab1..774cd6f63c8 100644 --- a/cli/cache/clean.go +++ b/cli/cache/clean.go @@ -28,8 +28,8 @@ import ( func initCleanCommand() *cobra.Command { cleanCommand := &cobra.Command{ Use: "clean", - Short: "Delete Boards/Library Manager download cache.", - Long: "Delete contents of the `directories.downloads` folder, where archive files are staged during installation of libraries and boards platforms.", + Short: tr("Delete Boards/Library Manager download cache."), + Long: tr("Delete contents of the `directories.downloads` folder, where archive files are staged during installation of libraries and boards platforms."), Example: " " + os.Args[0] + " cache clean", Args: cobra.NoArgs, Run: runCleanCommand, @@ -43,7 +43,7 @@ func runCleanCommand(cmd *cobra.Command, args []string) { cachePath := configuration.Settings.GetString("directories.Downloads") err := os.RemoveAll(cachePath) if err != nil { - feedback.Errorf("Error cleaning caches: %v", err) + feedback.Errorf(tr("Error cleaning caches: %v"), err) os.Exit(errorcodes.ErrGeneric) } } diff --git a/cli/cli.go b/cli/cli.go index cf54817cb6b..f6de47be086 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -64,9 +64,9 @@ func NewCommand() *cobra.Command { // ArduinoCli is the root command arduinoCli := &cobra.Command{ Use: "arduino-cli", - Short: "Arduino CLI.", - Long: "Arduino Command Line Interface (arduino-cli).", - Example: " " + os.Args[0] + " [flags...]", + Short: tr("Arduino CLI."), + Long: tr("Arduino Command Line Interface (arduino-cli)."), + Example: fmt.Sprintf(" %s <%s> [%s...]", os.Args[0], tr("command"), tr("flags")), PersistentPreRun: preRun, } @@ -97,13 +97,13 @@ func createCliCommandTree(cmd *cobra.Command) { cmd.AddCommand(burnbootloader.NewCommand()) cmd.AddCommand(version.NewCommand()) - cmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Print the logs on the standard output.") - cmd.PersistentFlags().String("log-level", "", "Messages with this level and above will be logged. Valid levels are: trace, debug, info, warn, error, fatal, panic") - cmd.PersistentFlags().String("log-file", "", "Path to the file where logs will be written.") - cmd.PersistentFlags().String("log-format", "", "The output format for the logs, can be {text|json}.") - cmd.PersistentFlags().StringVar(&outputFormat, "format", "text", "The output format, can be {text|json}.") - cmd.PersistentFlags().StringVar(&configFile, "config-file", "", "The custom config file (if not specified the default will be used).") - cmd.PersistentFlags().StringSlice("additional-urls", []string{}, "Comma-separated list of additional URLs for the Boards Manager.") + cmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, tr("Print the logs on the standard output.")) + cmd.PersistentFlags().String("log-level", "", fmt.Sprintf(tr("Messages with this level and above will be logged. Valid levels are: %s, %s, %s, %s, %s, %s, %s"), "trace", "debug", "info", "warn", "error", "fatal", "panic")) + cmd.PersistentFlags().String("log-file", "", tr("Path to the file where logs will be written.")) + cmd.PersistentFlags().String("log-format", "", fmt.Sprintf(tr("The output format for the logs, can be {%s|%s}."), "text", "json")) + cmd.PersistentFlags().StringVar(&outputFormat, "format", "text", fmt.Sprintf(tr("The output format, can be {%s|%s}."), "text", "json")) + cmd.PersistentFlags().StringVar(&configFile, "config-file", "", tr("The custom config file (if not specified the default will be used).")) + cmd.PersistentFlags().StringSlice("additional-urls", []string{}, tr("Comma-separated list of additional URLs for the Boards Manager.")) configuration.BindFlags(cmd, configuration.Settings) } @@ -168,7 +168,7 @@ func preRun(cmd *cobra.Command, args []string) { if logFile != "" { file, err := os.OpenFile(logFile, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) if err != nil { - fmt.Printf("Unable to open file for logging: %s", logFile) + fmt.Printf(tr("Unable to open file for logging: %s"), logFile) os.Exit(errorcodes.ErrBadCall) } @@ -182,7 +182,7 @@ func preRun(cmd *cobra.Command, args []string) { // configure logging filter if lvl, found := toLogLevel(configuration.Settings.GetString("logging.level")); !found { - feedback.Errorf("Invalid option for --log-level: %s", configuration.Settings.GetString("logging.level")) + feedback.Errorf(tr("Invalid option for --log-level: %s"), configuration.Settings.GetString("logging.level")) os.Exit(errorcodes.ErrBadArgument) } else { logrus.SetLevel(lvl) @@ -199,7 +199,7 @@ func preRun(cmd *cobra.Command, args []string) { // check the right output format was passed format, found := parseFormatString(outputFormat) if !found { - feedback.Error("Invalid output format: " + outputFormat) + feedback.Errorf(tr("Invalid output format: %s"), outputFormat) os.Exit(errorcodes.ErrBadCall) } @@ -221,7 +221,7 @@ func preRun(cmd *cobra.Command, args []string) { if outputFormat != "text" { cmd.SetHelpFunc(func(cmd *cobra.Command, args []string) { logrus.Warn("Calling help on JSON format") - feedback.Error("Invalid Call : should show Help, but it is available only in TEXT mode.") + feedback.Error(tr("Invalid Call : should show Help, but it is available only in TEXT mode.")) os.Exit(errorcodes.ErrBadCall) }) } diff --git a/cli/compile/compile.go b/cli/compile/compile.go index eac43f41150..990cc524c9d 100644 --- a/cli/compile/compile.go +++ b/cli/compile/compile.go @@ -19,12 +19,14 @@ import ( "bytes" "context" "encoding/json" + "fmt" "os" "github.com/arduino/arduino-cli/arduino/sketch" "github.com/arduino/arduino-cli/cli/feedback" "github.com/arduino/arduino-cli/cli/output" "github.com/arduino/arduino-cli/configuration" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/cli/errorcodes" "github.com/arduino/arduino-cli/cli/instance" @@ -61,14 +63,15 @@ var ( // libraries expects a path to a directory containing multiple libraries, similarly to the /libraries path. library []string // List of paths to libraries root folders. Can be used multiple times for different libraries libraries []string // List of custom libraries dir paths separated by commas. Or can be used multiple times for multiple libraries paths. + tr = i18n.Tr ) // NewCommand created a new `compile` command func NewCommand() *cobra.Command { command := &cobra.Command{ Use: "compile", - Short: "Compiles Arduino sketches.", - Long: "Compiles Arduino sketches.", + Short: tr("Compiles Arduino sketches."), + Long: tr("Compiles Arduino sketches."), Example: "" + " " + os.Args[0] + " compile -b arduino:avr:uno /home/user/Arduino/MySketch\n" + " " + os.Args[0] + ` compile -b arduino:avr:uno --build-property "build.extra_flags=\"-DMY_DEFINE=\"hello world\"\"" /home/user/Arduino/MySketch` + "\n" + @@ -78,43 +81,43 @@ func NewCommand() *cobra.Command { Run: run, } - command.Flags().StringVarP(&fqbn, "fqbn", "b", "", "Fully Qualified Board Name, e.g.: arduino:avr:uno") - command.Flags().BoolVar(&showProperties, "show-properties", false, "Show all build properties used instead of compiling.") - command.Flags().BoolVar(&preprocess, "preprocess", false, "Print preprocessed code to stdout instead of compiling.") - command.Flags().StringVar(&buildCachePath, "build-cache-path", "", "Builds of 'core.a' are saved into this path to be cached and reused.") - command.Flags().StringVarP(&exportDir, "output-dir", "", "", "Save build artifacts in this directory.") + command.Flags().StringVarP(&fqbn, "fqbn", "b", "", tr("Fully Qualified Board Name, e.g.: arduino:avr:uno")) + command.Flags().BoolVar(&showProperties, "show-properties", false, tr("Show all build properties used instead of compiling.")) + command.Flags().BoolVar(&preprocess, "preprocess", false, tr("Print preprocessed code to stdout instead of compiling.")) + command.Flags().StringVar(&buildCachePath, "build-cache-path", "", tr("Builds of 'core.a' are saved into this path to be cached and reused.")) + command.Flags().StringVarP(&exportDir, "output-dir", "", "", tr("Save build artifacts in this directory.")) command.Flags().StringVar(&buildPath, "build-path", "", - "Path where to save compiled files. If omitted, a directory will be created in the default temporary path of your OS.") + tr("Path where to save compiled files. If omitted, a directory will be created in the default temporary path of your OS.")) command.Flags().StringSliceVar(&buildProperties, "build-properties", []string{}, - "List of custom build properties separated by commas. Or can be used multiple times for multiple properties.") + tr("List of custom build properties separated by commas. Or can be used multiple times for multiple properties.")) command.Flags().StringArrayVar(&buildProperties, "build-property", []string{}, - "Override a build property with a custom value. Can be used multiple times for multiple properties.") + tr("Override a build property with a custom value. Can be used multiple times for multiple properties.")) command.Flags().StringVar(&warnings, "warnings", "none", - `Optional, can be "none", "default", "more" and "all". Defaults to "none". Used to tell gcc which warning level to use (-W flag).`) - command.Flags().BoolVarP(&verbose, "verbose", "v", false, "Optional, turns on verbose mode.") - command.Flags().BoolVar(&quiet, "quiet", false, "Optional, suppresses almost every output.") - command.Flags().BoolVarP(&uploadAfterCompile, "upload", "u", false, "Upload the binary after the compilation.") - command.Flags().StringVarP(&port, "port", "p", "", "Upload port, e.g.: COM10 or /dev/ttyACM0") - command.Flags().BoolVarP(&verify, "verify", "t", false, "Verify uploaded binary after the upload.") - command.Flags().StringVar(&vidPid, "vid-pid", "", "When specified, VID/PID specific build properties are used, if board supports them.") + fmt.Sprintf(tr(`Optional, can be "%[1]s", "%[2]s", "%[3]s" and "%[4]s". Defaults to "%[1]s". Used to tell gcc which warning level to use (-W flag).`), "none", "default", "more", "all")) + command.Flags().BoolVarP(&verbose, "verbose", "v", false, tr("Optional, turns on verbose mode.")) + command.Flags().BoolVar(&quiet, "quiet", false, tr("Optional, suppresses almost every output.")) + command.Flags().BoolVarP(&uploadAfterCompile, "upload", "u", false, tr("Upload the binary after the compilation.")) + command.Flags().StringVarP(&port, "port", "p", "", tr("Upload port, e.g.: COM10 or /dev/ttyACM0")) + command.Flags().BoolVarP(&verify, "verify", "t", false, tr("Verify uploaded binary after the upload.")) + command.Flags().StringVar(&vidPid, "vid-pid", "", tr("When specified, VID/PID specific build properties are used, if board supports them.")) command.Flags().StringSliceVar(&library, "library", []string{}, - "List of paths to libraries root folders. Libraries set this way have top priority in case of conflicts. Can be used multiple times for different libraries.") + tr("List of paths to libraries root folders. Libraries set this way have top priority in case of conflicts. Can be used multiple times for different libraries.")) command.Flags().StringSliceVar(&libraries, "libraries", []string{}, - "List of custom libraries dir paths separated by commas. Or can be used multiple times for multiple libraries dir paths.") - command.Flags().BoolVar(&optimizeForDebug, "optimize-for-debug", false, "Optional, optimize compile output for debugging, rather than for release.") - command.Flags().StringVarP(&programmer, "programmer", "P", "", "Optional, use the specified programmer to upload.") - command.Flags().BoolVar(&compilationDatabaseOnly, "only-compilation-database", false, "Just produce the compilation database, without actually compiling.") - command.Flags().BoolVar(&clean, "clean", false, "Optional, cleanup the build folder and do not use any cached build.") + tr("List of custom libraries dir paths separated by commas. Or can be used multiple times for multiple libraries dir paths.")) + command.Flags().BoolVar(&optimizeForDebug, "optimize-for-debug", false, tr("Optional, optimize compile output for debugging, rather than for release.")) + command.Flags().StringVarP(&programmer, "programmer", "P", "", tr("Optional, use the specified programmer to upload.")) + command.Flags().BoolVar(&compilationDatabaseOnly, "only-compilation-database", false, tr("Just produce the compilation database, without actually compiling.")) + command.Flags().BoolVar(&clean, "clean", false, tr("Optional, cleanup the build folder and do not use any cached build.")) // We must use the following syntax for this flag since it's also bound to settings. // This must be done because the value is set when the binding is accessed from viper. Accessing from cobra would only // read the value if the flag is set explicitly by the user. - command.Flags().BoolP("export-binaries", "e", false, "If set built binaries will be exported to the sketch folder.") - command.Flags().StringVar(&sourceOverrides, "source-override", "", "Optional. Path to a .json file that contains a set of replacements of the sketch source code.") + command.Flags().BoolP("export-binaries", "e", false, tr("If set built binaries will be exported to the sketch folder.")) + command.Flags().StringVar(&sourceOverrides, "source-override", "", tr("Optional. Path to a .json file that contains a set of replacements of the sketch source code.")) command.Flag("source-override").Hidden = true configuration.Settings.BindPFlag("sketch.always_export_binaries", command.Flags().Lookup("export-binaries")) - command.Flags().MarkDeprecated("build-properties", "please use --build-property instead.") + command.Flags().MarkDeprecated("build-properties", tr("please use --build-property instead.")) return command } @@ -131,7 +134,7 @@ func run(cmd *cobra.Command, args []string) { // .pde files are still supported but deprecated, this warning urges the user to rename them if files := sketch.CheckForPdeFiles(sketchPath); len(files) > 0 { - feedback.Error("Sketches with .pde extension are deprecated, please rename the following files to .ino:") + feedback.Error(tr("Sketches with .pde extension are deprecated, please rename the following files to .ino:")) for _, f := range files { feedback.Error(f) } @@ -141,14 +144,14 @@ func run(cmd *cobra.Command, args []string) { if sourceOverrides != "" { data, err := paths.New(sourceOverrides).ReadFile() if err != nil { - feedback.Errorf("Error opening source code overrides data file: %v", err) + feedback.Errorf(tr("Error opening source code overrides data file: %v"), err) os.Exit(errorcodes.ErrGeneric) } var o struct { Overrides map[string]string `json:"overrides"` } if err := json.Unmarshal(data, &o); err != nil { - feedback.Errorf("Error: invalid source code overrides data file: %v", err) + feedback.Errorf(tr("Error: invalid source code overrides data file: %v"), err) os.Exit(errorcodes.ErrGeneric) } overrides = o.Overrides @@ -207,7 +210,7 @@ func run(cmd *cobra.Command, args []string) { _, err = upload.Upload(context.Background(), uploadRequest, os.Stdout, os.Stderr) } if err != nil { - feedback.Errorf("Error during Upload: %v", err) + feedback.Errorf(tr("Error during Upload: %v"), err) os.Exit(errorcodes.ErrGeneric) } } @@ -219,7 +222,7 @@ func run(cmd *cobra.Command, args []string) { Success: err == nil, }) if err != nil && output.OutputFormat != "json" { - feedback.Errorf("Error during build: %v", err) + feedback.Errorf(tr("Error during build: %v"), err) os.Exit(errorcodes.ErrGeneric) } } @@ -232,7 +235,7 @@ func initSketchPath(sketchPath *paths.Path) *paths.Path { wd, err := paths.Getwd() if err != nil { - feedback.Errorf("Couldn't get current working directory: %v", err) + feedback.Errorf(tr("Couldn't get current working directory: %v"), err) os.Exit(errorcodes.ErrGeneric) } logrus.Infof("Reading sketch from dir: %s", wd) diff --git a/cli/completion/completion.go b/cli/completion/completion.go index 0514c74e592..1dd2a05c6bb 100644 --- a/cli/completion/completion.go +++ b/cli/completion/completion.go @@ -20,11 +20,13 @@ import ( "github.com/arduino/arduino-cli/cli/errorcodes" "github.com/arduino/arduino-cli/cli/feedback" + "github.com/arduino/arduino-cli/i18n" "github.com/spf13/cobra" ) var ( completionNoDesc bool //Disable completion description for shells that support it + tr = i18n.Tr ) // NewCommand created a new `completion` command @@ -33,20 +35,20 @@ func NewCommand() *cobra.Command { Use: "completion [bash|zsh|fish] [--no-descriptions]", ValidArgs: []string{"bash", "zsh", "fish"}, Args: cobra.ExactArgs(1), - Short: "Generates completion scripts", - Long: "Generates completion scripts for various shells", + Short: tr("Generates completion scripts"), + Long: tr("Generates completion scripts for various shells"), Example: " " + os.Args[0] + " completion bash > completion.sh\n" + " " + "source completion.sh", Run: run, } - command.Flags().BoolVar(&completionNoDesc, "no-descriptions", false, "Disable completion description for shells that support it") + command.Flags().BoolVar(&completionNoDesc, "no-descriptions", false, tr("Disable completion description for shells that support it")) return command } func run(cmd *cobra.Command, args []string) { if completionNoDesc && (args[0] == "bash") { - feedback.Errorf("Error: command description is not supported by %v", args[0]) + feedback.Errorf(tr("Error: command description is not supported by %v"), args[0]) os.Exit(errorcodes.ErrGeneric) } switch args[0] { diff --git a/cli/config/add.go b/cli/config/add.go index ca62731be37..da5096fa5f9 100644 --- a/cli/config/add.go +++ b/cli/config/add.go @@ -28,8 +28,8 @@ import ( func initAddCommand() *cobra.Command { addCommand := &cobra.Command{ Use: "add", - Short: "Adds one or more values to a setting.", - Long: "Adds one or more values to a setting.", + Short: tr("Adds one or more values to a setting."), + Long: tr("Adds one or more values to a setting."), Example: "" + " " + os.Args[0] + " config add board_manager.additional_urls https://example.com/package_example_index.json\n" + " " + os.Args[0] + " config add board_manager.additional_urls https://example.com/package_example_index.json https://another-url.com/package_another_index.json\n", @@ -48,7 +48,7 @@ func runAddCommand(cmd *cobra.Command, args []string) { } if kind != reflect.Slice { - feedback.Errorf("The key '%v' is not a list of items, can't add to it.\nMaybe use 'config set'?", key) + feedback.Errorf(tr("The key '%[1]v' is not a list of items, can't add to it.\nMaybe use '%[2]s'?"), key, "config set") os.Exit(errorcodes.ErrGeneric) } @@ -57,7 +57,7 @@ func runAddCommand(cmd *cobra.Command, args []string) { configuration.Settings.Set(key, v) if err := configuration.Settings.WriteConfig(); err != nil { - feedback.Errorf("Can't write config file: %v", err) + feedback.Errorf(tr("Can't write config file: %v"), err) os.Exit(errorcodes.ErrGeneric) } } diff --git a/cli/config/config.go b/cli/config/config.go index c4f69ab6863..b91a0ddb7d5 100644 --- a/cli/config/config.go +++ b/cli/config/config.go @@ -18,14 +18,17 @@ package config import ( "os" + "github.com/arduino/arduino-cli/i18n" "github.com/spf13/cobra" ) +var tr = i18n.Tr + // NewCommand created a new `config` command func NewCommand() *cobra.Command { configCommand := &cobra.Command{ Use: "config", - Short: "Arduino configuration commands.", + Short: tr("Arduino configuration commands."), Example: " " + os.Args[0] + " config init", } diff --git a/cli/config/delete.go b/cli/config/delete.go index a45d7651c77..8b3c2693e4c 100644 --- a/cli/config/delete.go +++ b/cli/config/delete.go @@ -29,8 +29,8 @@ import ( func initDeleteCommand() *cobra.Command { addCommand := &cobra.Command{ Use: "delete", - Short: "Deletes a settings key and all its sub keys.", - Long: "Deletes a settings key and all its sub keys.", + Short: tr("Deletes a settings key and all its sub keys."), + Long: tr("Deletes a settings key and all its sub keys."), Example: "" + " " + os.Args[0] + " config delete board_manager\n" + " " + os.Args[0] + " config delete board_manager.additional_urls", @@ -54,7 +54,7 @@ func runDeleteCommand(cmd *cobra.Command, args []string) { } if !exists { - feedback.Errorf("Settings key doesn't exist") + feedback.Errorf(tr("Settings key doesn't exist")) os.Exit(errorcodes.ErrGeneric) } @@ -64,7 +64,7 @@ func runDeleteCommand(cmd *cobra.Command, args []string) { } if err := updatedSettings.WriteConfigAs(configuration.Settings.ConfigFileUsed()); err != nil { - feedback.Errorf("Can't write config file: %v", err) + feedback.Errorf(tr("Can't write config file: %v"), err) os.Exit(errorcodes.ErrGeneric) } } diff --git a/cli/config/dump.go b/cli/config/dump.go index 90b20bcaedb..a81de706bb4 100644 --- a/cli/config/dump.go +++ b/cli/config/dump.go @@ -28,8 +28,8 @@ import ( func initDumpCmd() *cobra.Command { var dumpCmd = &cobra.Command{ Use: "dump", - Short: "Prints the current configuration", - Long: "Prints the current configuration.", + Short: tr("Prints the current configuration"), + Long: tr("Prints the current configuration."), Example: " " + os.Args[0] + " config dump", Args: cobra.NoArgs, Run: runDumpCommand, @@ -50,7 +50,7 @@ func (dr dumpResult) Data() interface{} { func (dr dumpResult) String() string { bs, err := yaml.Marshal(dr.data) if err != nil { - feedback.Errorf("unable to marshal config to YAML: %v", err) + feedback.Errorf(tr("unable to marshal config to YAML: %v"), err) return "" } diff --git a/cli/config/init.go b/cli/config/init.go index a242e7e3fd6..c3110b6091b 100644 --- a/cli/config/init.go +++ b/cli/config/init.go @@ -16,6 +16,7 @@ package config import ( + "fmt" "os" "github.com/arduino/arduino-cli/cli/errorcodes" @@ -38,25 +39,25 @@ const defaultFileName = "arduino-cli.yaml" func initInitCommand() *cobra.Command { initCommand := &cobra.Command{ Use: "init", - Short: "Writes current configuration to a configuration file.", - Long: "Creates or updates the configuration file in the data directory or custom directory with the current configuration settings.", + Short: tr("Writes current configuration to a configuration file."), + Long: tr("Creates or updates the configuration file in the data directory or custom directory with the current configuration settings."), Example: "" + - " # Writes current configuration to the configuration file in the data directory.\n" + + " # " + tr("Writes current configuration to the configuration file in the data directory.") + "\n" + " " + os.Args[0] + " config init\n" + " " + os.Args[0] + " config init --dest-dir /home/user/MyDirectory\n" + " " + os.Args[0] + " config init --dest-file /home/user/MyDirectory/my_settings.yaml", Args: cobra.NoArgs, Run: runInitCommand, } - initCommand.Flags().StringVar(&destDir, "dest-dir", "", "Sets where to save the configuration file.") - initCommand.Flags().StringVar(&destFile, "dest-file", "", "Sets where to save the configuration file.") - initCommand.Flags().BoolVar(&overwrite, "overwrite", false, "Overwrite existing config file.") + initCommand.Flags().StringVar(&destDir, "dest-dir", "", tr("Sets where to save the configuration file.")) + initCommand.Flags().StringVar(&destFile, "dest-file", "", tr("Sets where to save the configuration file.")) + initCommand.Flags().BoolVar(&overwrite, "overwrite", false, tr("Overwrite existing config file.")) return initCommand } func runInitCommand(cmd *cobra.Command, args []string) { if destFile != "" && destDir != "" { - feedback.Errorf("Can't use both --dest-file and --dest-dir flags at the same time.") + feedback.Errorf(tr("Can't use both --dest-file and --dest-dir flags at the same time.")) os.Exit(errorcodes.ErrGeneric) } @@ -68,7 +69,7 @@ func runInitCommand(cmd *cobra.Command, args []string) { case destFile != "": configFileAbsPath, err = paths.New(destFile).Abs() if err != nil { - feedback.Errorf("Cannot find absolute path: %v", err) + feedback.Errorf(tr("Cannot find absolute path: %v"), err) os.Exit(errorcodes.ErrGeneric) } @@ -79,21 +80,21 @@ func runInitCommand(cmd *cobra.Command, args []string) { default: absPath, err = paths.New(destDir).Abs() if err != nil { - feedback.Errorf("Cannot find absolute path: %v", err) + feedback.Errorf(tr("Cannot find absolute path: %v"), err) os.Exit(errorcodes.ErrGeneric) } configFileAbsPath = absPath.Join(defaultFileName) } if !overwrite && configFileAbsPath.Exist() { - feedback.Error("Config file already exists, use --overwrite to discard the existing one.") + feedback.Error(tr("Config file already exists, use --overwrite to discard the existing one.")) os.Exit(errorcodes.ErrGeneric) } logrus.Infof("Writing config file to: %s", absPath) if err := absPath.MkdirAll(); err != nil { - feedback.Errorf("Cannot create config file directory: %v", err) + feedback.Errorf(tr("Cannot create config file directory: %v"), err) os.Exit(errorcodes.ErrGeneric) } @@ -102,11 +103,11 @@ func runInitCommand(cmd *cobra.Command, args []string) { configuration.BindFlags(cmd, newSettings) if err := newSettings.WriteConfigAs(configFileAbsPath.String()); err != nil { - feedback.Errorf("Cannot create config file: %v", err) + feedback.Errorf(tr("Cannot create config file: %v"), err) os.Exit(errorcodes.ErrGeneric) } - msg := "Config file written to: " + configFileAbsPath.String() + msg := fmt.Sprintf(tr("Config file written to: %s"), configFileAbsPath.String()) logrus.Info(msg) feedback.Print(msg) } diff --git a/cli/config/remove.go b/cli/config/remove.go index f5101a03bab..c5181f2bc63 100644 --- a/cli/config/remove.go +++ b/cli/config/remove.go @@ -28,8 +28,8 @@ import ( func initRemoveCommand() *cobra.Command { addCommand := &cobra.Command{ Use: "remove", - Short: "Removes one or more values from a setting.", - Long: "Removes one or more values from a setting.", + Short: tr("Removes one or more values from a setting."), + Long: tr("Removes one or more values from a setting."), Example: "" + " " + os.Args[0] + " config remove board_manager.additional_urls https://example.com/package_example_index.json\n" + " " + os.Args[0] + " config remove board_manager.additional_urls https://example.com/package_example_index.json https://another-url.com/package_another_index.json\n", @@ -48,7 +48,7 @@ func runRemoveCommand(cmd *cobra.Command, args []string) { } if kind != reflect.Slice { - feedback.Errorf("The key '%v' is not a list of items, can't remove from it.\nMaybe use 'config delete'?", key) + feedback.Errorf(tr("The key '%[1]v' is not a list of items, can't remove from it.\nMaybe use '%[2]s'?"), key, "config delete") os.Exit(errorcodes.ErrGeneric) } @@ -66,7 +66,7 @@ func runRemoveCommand(cmd *cobra.Command, args []string) { configuration.Settings.Set(key, values) if err := configuration.Settings.WriteConfig(); err != nil { - feedback.Errorf("Can't write config file: %v", err) + feedback.Errorf(tr("Can't write config file: %v"), err) os.Exit(errorcodes.ErrGeneric) } } diff --git a/cli/config/set.go b/cli/config/set.go index 6d397c2b69d..afb07928280 100644 --- a/cli/config/set.go +++ b/cli/config/set.go @@ -29,8 +29,8 @@ import ( func initSetCommand() *cobra.Command { addCommand := &cobra.Command{ Use: "set", - Short: "Sets a setting value.", - Long: "Sets a setting value.", + Short: tr("Sets a setting value."), + Long: tr("Sets a setting value."), Example: "" + " " + os.Args[0] + " config set logging.level trace\n" + " " + os.Args[0] + " config set logging.file my-log.txt\n" + @@ -51,7 +51,7 @@ func runSetCommand(cmd *cobra.Command, args []string) { } if kind != reflect.Slice && len(args) > 2 { - feedback.Errorf("Can't set multiple values in key %v", key) + feedback.Errorf(tr("Can't set multiple values in key %v"), key) os.Exit(errorcodes.ErrGeneric) } @@ -65,7 +65,7 @@ func runSetCommand(cmd *cobra.Command, args []string) { var err error value, err = strconv.ParseBool(args[1]) if err != nil { - feedback.Errorf("error parsing value: %v", err) + feedback.Errorf(tr("error parsing value: %v"), err) os.Exit(errorcodes.ErrGeneric) } } @@ -73,7 +73,7 @@ func runSetCommand(cmd *cobra.Command, args []string) { configuration.Settings.Set(key, value) if err := configuration.Settings.WriteConfig(); err != nil { - feedback.Errorf("Writing config file: %v", err) + feedback.Errorf(tr("Writing config file: %v"), err) os.Exit(errorcodes.ErrGeneric) } } diff --git a/cli/config/validate.go b/cli/config/validate.go index cdb7f54bd63..032706fadcc 100644 --- a/cli/config/validate.go +++ b/cli/config/validate.go @@ -40,7 +40,7 @@ var validMap = map[string]reflect.Kind{ func typeOf(key string) (reflect.Kind, error) { t, ok := validMap[key] if !ok { - return reflect.Invalid, fmt.Errorf("Settings key doesn't exist") + return reflect.Invalid, fmt.Errorf(tr("Settings key doesn't exist")) } return t, nil } diff --git a/cli/core/core.go b/cli/core/core.go index 8b60b48de63..f040d3e2efc 100644 --- a/cli/core/core.go +++ b/cli/core/core.go @@ -18,15 +18,18 @@ package core import ( "os" + "github.com/arduino/arduino-cli/i18n" "github.com/spf13/cobra" ) +var tr = i18n.Tr + // NewCommand created a new `core` command func NewCommand() *cobra.Command { coreCommand := &cobra.Command{ Use: "core", - Short: "Arduino core operations.", - Long: "Arduino core operations.", + Short: tr("Arduino core operations."), + Long: tr("Arduino core operations."), Example: " " + os.Args[0] + " core update-index", } diff --git a/cli/core/download.go b/cli/core/download.go index e55b23d06eb..a89264edd8e 100644 --- a/cli/core/download.go +++ b/cli/core/download.go @@ -17,6 +17,7 @@ package core import ( "context" + "fmt" "os" "github.com/arduino/arduino-cli/cli/errorcodes" @@ -32,12 +33,12 @@ import ( func initDownloadCommand() *cobra.Command { downloadCommand := &cobra.Command{ - Use: "download [PACKAGER:ARCH[@VERSION]](S)", - Short: "Downloads one or more cores and corresponding tool dependencies.", - Long: "Downloads one or more cores and corresponding tool dependencies.", + Use: fmt.Sprintf(tr("download [%s:%s[@%s]]..."), tr("PACKAGER"), tr("ARCH"), tr("VERSION")), + Short: tr("Downloads one or more cores and corresponding tool dependencies."), + Long: tr("Downloads one or more cores and corresponding tool dependencies."), Example: "" + - " " + os.Args[0] + " core download arduino:samd # to download the latest version of Arduino SAMD core.\n" + - " " + os.Args[0] + " core download arduino:samd@1.6.9 # for a specific version (in this case 1.6.9).", + " " + os.Args[0] + " core download arduino:samd # " + tr("to download the latest version of Arduino SAMD core.\n") + + " " + os.Args[0] + " core download arduino:samd@1.6.9 # " + tr("for a specific version (in this case 1.6.9)."), Args: cobra.MinimumNArgs(1), Run: runDownloadCommand, } @@ -51,7 +52,7 @@ func runDownloadCommand(cmd *cobra.Command, args []string) { platformsRefs, err := globals.ParseReferenceArgs(args, true) if err != nil { - feedback.Errorf("Invalid argument passed: %v", err) + feedback.Errorf(tr("Invalid argument passed: %v"), err) os.Exit(errorcodes.ErrBadArgument) } @@ -64,7 +65,7 @@ func runDownloadCommand(cmd *cobra.Command, args []string) { } _, err := core.PlatformDownload(context.Background(), platformDownloadreq, output.ProgressBar()) if err != nil { - feedback.Errorf("Error downloading %s: %v", args[i], err) + feedback.Errorf(tr("Error downloading %[1]s: %[2]v"), args[i], err) os.Exit(errorcodes.ErrNetwork) } } diff --git a/cli/core/install.go b/cli/core/install.go index 69790d4c243..632757d36c7 100644 --- a/cli/core/install.go +++ b/cli/core/install.go @@ -17,6 +17,7 @@ package core import ( "context" + "fmt" "os" "github.com/arduino/arduino-cli/cli/errorcodes" @@ -33,12 +34,12 @@ import ( func initInstallCommand() *cobra.Command { installCommand := &cobra.Command{ - Use: "install PACKAGER:ARCH[@VERSION] ...", - Short: "Installs one or more cores and corresponding tool dependencies.", - Long: "Installs one or more cores and corresponding tool dependencies.", - Example: " # download the latest version of Arduino SAMD core.\n" + + Use: fmt.Sprintf("install %s:%s[@%s]...", tr("PACKAGER"), tr("ARCH"), tr("VERSION")), + Short: tr("Installs one or more cores and corresponding tool dependencies."), + Long: tr("Installs one or more cores and corresponding tool dependencies."), + Example: " # " + tr("download the latest version of Arduino SAMD core.") + "\n" + " " + os.Args[0] + " core install arduino:samd\n\n" + - " # download a specific version (in this case 1.6.9).\n" + + " # " + tr("download a specific version (in this case 1.6.9).") + "\n" + " " + os.Args[0] + " core install arduino:samd@1.6.9", Args: cobra.MinimumNArgs(1), Run: runInstallCommand, @@ -55,14 +56,14 @@ var postInstallFlags struct { // AddPostInstallFlagsToCommand adds flags that can be used to force running or skipping // of post installation scripts func AddPostInstallFlagsToCommand(cmd *cobra.Command) { - cmd.Flags().BoolVar(&postInstallFlags.runPostInstall, "run-post-install", false, "Force run of post-install scripts (if the CLI is not running interactively).") - cmd.Flags().BoolVar(&postInstallFlags.skipPostInstall, "skip-post-install", false, "Force skip of post-install scripts (if the CLI is running interactively).") + cmd.Flags().BoolVar(&postInstallFlags.runPostInstall, "run-post-install", false, tr("Force run of post-install scripts (if the CLI is not running interactively).")) + cmd.Flags().BoolVar(&postInstallFlags.skipPostInstall, "skip-post-install", false, tr("Force skip of post-install scripts (if the CLI is running interactively).")) } // DetectSkipPostInstallValue returns true if a post install script must be run func DetectSkipPostInstallValue() bool { if postInstallFlags.runPostInstall && postInstallFlags.skipPostInstall { - feedback.Errorf("The flags --run-post-install and --skip-post-install can't be both set at the same time.") + feedback.Errorf(tr("The flags --run-post-install and --skip-post-install can't be both set at the same time.")) os.Exit(errorcodes.ErrBadArgument) } if postInstallFlags.runPostInstall { @@ -88,7 +89,7 @@ func runInstallCommand(cmd *cobra.Command, args []string) { platformsRefs, err := globals.ParseReferenceArgs(args, true) if err != nil { - feedback.Errorf("Invalid argument passed: %v", err) + feedback.Errorf(tr("Invalid argument passed: %v"), err) os.Exit(errorcodes.ErrBadArgument) } @@ -102,7 +103,7 @@ func runInstallCommand(cmd *cobra.Command, args []string) { } _, err := core.PlatformInstall(context.Background(), platformInstallRequest, output.ProgressBar(), output.TaskProgress()) if err != nil { - feedback.Errorf("Error during install: %v", err) + feedback.Errorf(tr("Error during install: %v"), err) os.Exit(errorcodes.ErrGeneric) } } diff --git a/cli/core/list.go b/cli/core/list.go index e111c426ce8..bd3a5132fdf 100644 --- a/cli/core/list.go +++ b/cli/core/list.go @@ -32,14 +32,14 @@ import ( func initListCommand() *cobra.Command { listCommand := &cobra.Command{ Use: "list", - Short: "Shows the list of installed platforms.", - Long: "Shows the list of installed platforms.", + Short: tr("Shows the list of installed platforms."), + Long: tr("Shows the list of installed platforms."), Example: " " + os.Args[0] + " core list", Args: cobra.NoArgs, Run: runListCommand, } - listCommand.Flags().BoolVar(&listFlags.updatableOnly, "updatable", false, "List updatable platforms.") - listCommand.Flags().BoolVar(&listFlags.all, "all", false, "If set return all installable and installed cores, including manually installed.") + listCommand.Flags().BoolVar(&listFlags.updatableOnly, "updatable", false, tr("List updatable platforms.")) + listCommand.Flags().BoolVar(&listFlags.all, "all", false, tr("If set return all installable and installed cores, including manually installed.")) return listCommand } @@ -58,7 +58,7 @@ func runListCommand(cmd *cobra.Command, args []string) { All: listFlags.all, }) if err != nil { - feedback.Errorf("Error listing platforms: %v", err) + feedback.Errorf(tr("Error listing platforms: %v"), err) os.Exit(errorcodes.ErrGeneric) } @@ -81,11 +81,11 @@ func (ir installedResult) String() string { } t := table.New() - t.SetHeader("ID", "Installed", "Latest", "Name") + t.SetHeader(tr("ID"), tr("Installed"), tr("Latest"), tr("Name")) for _, p := range ir.platforms { name := p.Name if p.Deprecated { - name = fmt.Sprintf("[DEPRECATED] %s", name) + name = fmt.Sprintf(tr("[DEPRECATED] %s"), name) } t.AddRow(p.Id, p.Installed, p.Latest, name) } diff --git a/cli/core/search.go b/cli/core/search.go index a41ba1b22b0..38aa80a16c4 100644 --- a/cli/core/search.go +++ b/cli/core/search.go @@ -45,14 +45,14 @@ var ( func initSearchCommand() *cobra.Command { searchCommand := &cobra.Command{ - Use: "search ", - Short: "Search for a core in Boards Manager.", - Long: "Search for a core in Boards Manager using the specified keywords.", + Use: fmt.Sprintf("search <%s...>", tr("keywords")), + Short: tr("Search for a core in Boards Manager."), + Long: tr("Search for a core in Boards Manager using the specified keywords."), Example: " " + os.Args[0] + " core search MKRZero -a -v", Args: cobra.ArbitraryArgs, Run: runSearchCommand, } - searchCommand.Flags().BoolVarP(&allVersions, "all", "a", false, "Show all available core versions.") + searchCommand.Flags().BoolVarP(&allVersions, "all", "a", false, tr("Show all available core versions.")) return searchCommand } @@ -63,7 +63,7 @@ const indexUpdateInterval = "24h" func runSearchCommand(cmd *cobra.Command, args []string) { inst, status := instance.Create() if status != nil { - feedback.Errorf("Error creating instance: %v", status) + feedback.Errorf(tr("Error creating instance: %v"), status) os.Exit(errorcodes.ErrGeneric) } @@ -72,13 +72,13 @@ func runSearchCommand(cmd *cobra.Command, args []string) { Instance: inst, }, output.ProgressBar()) if err != nil { - feedback.Errorf("Error updating index: %v", err) + feedback.Errorf(tr("Error updating index: %v"), err) os.Exit(errorcodes.ErrGeneric) } } for _, err := range instance.Init(inst) { - feedback.Errorf("Error initializing instance: %v", err) + feedback.Errorf(tr("Error initializing instance: %v"), err) } arguments := strings.ToLower(strings.Join(args, " ")) @@ -90,7 +90,7 @@ func runSearchCommand(cmd *cobra.Command, args []string) { AllVersions: allVersions, }) if err != nil { - feedback.Errorf("Error searching for platforms: %v", err) + feedback.Errorf(tr("Error searching for platforms: %v"), err) os.Exit(errorcodes.ErrGeneric) } @@ -111,17 +111,17 @@ func (sr searchResults) Data() interface{} { func (sr searchResults) String() string { if len(sr.platforms) > 0 { t := table.New() - t.SetHeader("ID", "Version", "Name") + t.SetHeader(tr("ID"), tr("Version"), tr("Name")) for _, item := range sr.platforms { name := item.GetName() if item.Deprecated { - name = fmt.Sprintf("[DEPRECATED] %s", name) + name = fmt.Sprintf(tr("[DEPRECATED] %s"), name) } t.AddRow(item.GetId(), item.GetLatest(), name) } return t.Render() } - return "No platforms matching your search." + return tr("No platforms matching your search.") } // indexesNeedUpdating returns whether one or more index files need updating. diff --git a/cli/core/uninstall.go b/cli/core/uninstall.go index 8a92d4aa29b..f3bd6731f04 100644 --- a/cli/core/uninstall.go +++ b/cli/core/uninstall.go @@ -17,6 +17,7 @@ package core import ( "context" + "fmt" "os" "github.com/arduino/arduino-cli/cli/errorcodes" @@ -32,9 +33,9 @@ import ( func initUninstallCommand() *cobra.Command { return &cobra.Command{ - Use: "uninstall PACKAGER:ARCH ...", - Short: "Uninstalls one or more cores and corresponding tool dependencies if no longer used.", - Long: "Uninstalls one or more cores and corresponding tool dependencies if no longer used.", + Use: fmt.Sprintf("uninstall %s:%s ...", tr("PACKAGER"), tr("ARCH")), + Short: tr("Uninstalls one or more cores and corresponding tool dependencies if no longer used."), + Long: tr("Uninstalls one or more cores and corresponding tool dependencies if no longer used."), Example: " " + os.Args[0] + " core uninstall arduino:samd\n", Args: cobra.MinimumNArgs(1), Run: runUninstallCommand, @@ -47,13 +48,13 @@ func runUninstallCommand(cmd *cobra.Command, args []string) { platformsRefs, err := globals.ParseReferenceArgs(args, true) if err != nil { - feedback.Errorf("Invalid argument passed: %v", err) + feedback.Errorf(tr("Invalid argument passed: %v"), err) os.Exit(errorcodes.ErrBadArgument) } for _, platformRef := range platformsRefs { if platformRef.Version != "" { - feedback.Error("Invalid parameter " + platformRef.String() + ": version not allowed") + feedback.Errorf(tr("Invalid parameter %s: version not allowed"), platformRef) os.Exit(errorcodes.ErrBadArgument) } } @@ -64,7 +65,7 @@ func runUninstallCommand(cmd *cobra.Command, args []string) { Architecture: platformRef.Architecture, }, output.NewTaskProgressCB()) if err != nil { - feedback.Errorf("Error during uninstall: %v", err) + feedback.Errorf(tr("Error during uninstall: %v"), err) os.Exit(errorcodes.ErrGeneric) } } diff --git a/cli/core/update_index.go b/cli/core/update_index.go index 16e177cec72..c104523ef77 100644 --- a/cli/core/update_index.go +++ b/cli/core/update_index.go @@ -32,8 +32,8 @@ import ( func initUpdateIndexCommand() *cobra.Command { updateIndexCommand := &cobra.Command{ Use: "update-index", - Short: "Updates the index of cores.", - Long: "Updates the index of cores to the latest version.", + Short: tr("Updates the index of cores."), + Long: tr("Updates the index of cores to the latest version."), Example: " " + os.Args[0] + " core update-index", Args: cobra.NoArgs, Run: runUpdateIndexCommand, @@ -49,7 +49,7 @@ func runUpdateIndexCommand(cmd *cobra.Command, args []string) { // as argument but none would be obviously found. inst, status := instance.Create() if status != nil { - feedback.Errorf("Error creating instance: %v", status) + feedback.Errorf(tr("Error creating instance: %v"), status) os.Exit(errorcodes.ErrGeneric) } @@ -58,7 +58,7 @@ func runUpdateIndexCommand(cmd *cobra.Command, args []string) { // we must use instance.Create instead of instance.CreateAndInit for the // reason stated above. if err := instance.FirstUpdate(inst); err != nil { - feedback.Errorf("Error updating indexes: %v", status) + feedback.Errorf(tr("Error updating indexes: %v"), status) os.Exit(errorcodes.ErrGeneric) } @@ -66,7 +66,7 @@ func runUpdateIndexCommand(cmd *cobra.Command, args []string) { Instance: inst, }, output.ProgressBar()) if err != nil { - feedback.Errorf("Error updating index: %v", err) + feedback.Errorf(tr("Error updating index: %v"), err) os.Exit(errorcodes.ErrGeneric) } } diff --git a/cli/core/upgrade.go b/cli/core/upgrade.go index f9467bc4126..a9ee598089c 100644 --- a/cli/core/upgrade.go +++ b/cli/core/upgrade.go @@ -17,6 +17,7 @@ package core import ( "context" + "fmt" "os" "github.com/arduino/arduino-cli/cli/errorcodes" @@ -32,13 +33,13 @@ import ( func initUpgradeCommand() *cobra.Command { upgradeCommand := &cobra.Command{ - Use: "upgrade [PACKAGER:ARCH] ...", - Short: "Upgrades one or all installed platforms to the latest version.", - Long: "Upgrades one or all installed platforms to the latest version.", + Use: fmt.Sprintf("upgrade [%s:%s] ...", tr("PACKAGER"), tr("ARCH")), + Short: tr("Upgrades one or all installed platforms to the latest version."), + Long: tr("Upgrades one or all installed platforms to the latest version."), Example: "" + - " # upgrade everything to the latest version\n" + + " # " + tr("upgrade everything to the latest version") + "\n" + " " + os.Args[0] + " core upgrade\n\n" + - " # upgrade arduino:samd to the latest version\n" + + " # " + tr("upgrade arduino:samd to the latest version") + "\n" + " " + os.Args[0] + " core upgrade arduino:samd", Run: runUpgradeCommand, } @@ -57,12 +58,12 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) { UpdatableOnly: true, }) if err != nil { - feedback.Errorf("Error retrieving core list: %v", err) + feedback.Errorf(tr("Error retrieving core list: %v"), err) os.Exit(errorcodes.ErrGeneric) } if len(targets) == 0 { - feedback.Print("All the cores are already at the latest version") + feedback.Print(tr("All the cores are already at the latest version")) return } @@ -75,13 +76,13 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) { exitErr := false platformsRefs, err := globals.ParseReferenceArgs(args, true) if err != nil { - feedback.Errorf("Invalid argument passed: %v", err) + feedback.Errorf(tr("Invalid argument passed: %v"), err) os.Exit(errorcodes.ErrBadArgument) } for i, platformRef := range platformsRefs { if platformRef.Version != "" { - feedback.Error(("Invalid item " + args[i])) + feedback.Errorf(tr("Invalid item %s"), args[i]) exitErr = true continue } @@ -95,9 +96,9 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) { _, err := core.PlatformUpgrade(context.Background(), r, output.ProgressBar(), output.TaskProgress()) if err == core.ErrAlreadyLatest { - feedback.Printf("Platform %s is already at the latest version", platformRef) + feedback.Printf(tr("Platform %s is already at the latest version"), platformRef) } else if err != nil { - feedback.Errorf("Error during upgrade: %v", err) + feedback.Errorf(tr("Error during upgrade: %v"), err) os.Exit(errorcodes.ErrGeneric) } } diff --git a/cli/daemon/daemon.go b/cli/daemon/daemon.go index 6289d243bb2..f085db90f99 100644 --- a/cli/daemon/daemon.go +++ b/cli/daemon/daemon.go @@ -29,6 +29,7 @@ import ( "github.com/arduino/arduino-cli/cli/globals" "github.com/arduino/arduino-cli/commands/daemon" "github.com/arduino/arduino-cli/configuration" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/metrics" srv_commands "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" srv_debug "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/debug/v1" @@ -40,19 +41,21 @@ import ( "google.golang.org/grpc" ) +var tr = i18n.Tr + // NewCommand created a new `daemon` command func NewCommand() *cobra.Command { cmd := &cobra.Command{ Use: "daemon", - Short: fmt.Sprintf("Run as a daemon on port %s", configuration.Settings.GetString("daemon.port")), - Long: "Running as a daemon the initialization of cores and libraries is done only once.", + Short: fmt.Sprintf(tr("Run as a daemon on port %s"), configuration.Settings.GetString("daemon.port")), + Long: tr("Running as a daemon the initialization of cores and libraries is done only once."), Example: " " + os.Args[0] + " daemon", Args: cobra.NoArgs, Run: runDaemonCommand, } - cmd.PersistentFlags().String("port", "", "The TCP port the daemon will listen to") + cmd.PersistentFlags().String("port", "", tr("The TCP port the daemon will listen to")) configuration.Settings.BindPFlag("daemon.port", cmd.PersistentFlags().Lookup("port")) - cmd.Flags().BoolVar(&daemonize, "daemonize", false, "Do not terminate daemon process if the parent process dies") + cmd.Flags().BoolVar(&daemonize, "daemonize", false, tr("Do not terminate daemon process if the parent process dies")) return cmd } @@ -102,22 +105,22 @@ func runDaemonCommand(cmd *cobra.Command, args []string) { // Invalid port, such as "Foo" var dnsError *net.DNSError if errors.As(err, &dnsError) { - feedback.Errorf("Failed to listen on TCP port: %s. %s is unknown name.", port, dnsError.Name) + feedback.Errorf(tr("Failed to listen on TCP port: %[1]s. %[2]s is unknown name."), port, dnsError.Name) os.Exit(errorcodes.ErrCoreConfig) } // Invalid port number, such as -1 var addrError *net.AddrError if errors.As(err, &addrError) { - feedback.Errorf("Failed to listen on TCP port: %s. %s is an invalid port.", port, addrError.Addr) + feedback.Errorf(tr("Failed to listen on TCP port: %[1]s. %[2]s is an invalid port."), port, addrError.Addr) os.Exit(errorcodes.ErrCoreConfig) } // Port is already in use var syscallErr *os.SyscallError if errors.As(err, &syscallErr) && errors.Is(syscallErr.Err, syscall.EADDRINUSE) { - feedback.Errorf("Failed to listen on TCP port: %s. Address already in use.", port) + feedback.Errorf(tr("Failed to listen on TCP port: %s. Address already in use."), port) os.Exit(errorcodes.ErrNetwork) } - feedback.Errorf("Failed to listen on TCP port: %s. Unexpected error: %v", port, err) + feedback.Errorf(tr("Failed to listen on TCP port: %[1]s. Unexpected error: %[2]v"), port, err) os.Exit(errorcodes.ErrGeneric) } // This message will show up on the stdout of the daemon process so that gRPC clients know it is time to connect. diff --git a/cli/debug/debug.go b/cli/debug/debug.go index a3fb3953a59..7fe8a355a1e 100644 --- a/cli/debug/debug.go +++ b/cli/debug/debug.go @@ -26,6 +26,7 @@ import ( "github.com/arduino/arduino-cli/cli/feedback" "github.com/arduino/arduino-cli/cli/instance" "github.com/arduino/arduino-cli/commands/debug" + "github.com/arduino/arduino-cli/i18n" dbg "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/debug/v1" "github.com/arduino/arduino-cli/table" "github.com/arduino/go-paths-helper" @@ -45,25 +46,26 @@ var ( importDir string printInfo bool programmer string + tr = i18n.Tr ) // NewCommand created a new `upload` command func NewCommand() *cobra.Command { debugCommand := &cobra.Command{ Use: "debug", - Short: "Debug Arduino sketches.", - Long: "Debug Arduino sketches. (this command opens an interactive gdb session)", + Short: tr("Debug Arduino sketches."), + Long: tr("Debug Arduino sketches. (this command opens an interactive gdb session)"), Example: " " + os.Args[0] + " debug -b arduino:samd:mkr1000 -P atmel_ice /home/user/Arduino/MySketch", Args: cobra.MaximumNArgs(1), Run: run, } - debugCommand.Flags().StringVarP(&fqbn, "fqbn", "b", "", "Fully Qualified Board Name, e.g.: arduino:avr:uno") - debugCommand.Flags().StringVarP(&port, "port", "p", "", "Debug port, e.g.: COM10 or /dev/ttyACM0") - debugCommand.Flags().StringVarP(&programmer, "programmer", "P", "", "Programmer to use for debugging") - debugCommand.Flags().StringVar(&interpreter, "interpreter", "console", "Debug interpreter e.g.: console, mi, mi1, mi2, mi3") - debugCommand.Flags().StringVarP(&importDir, "input-dir", "", "", "Directory containing binaries for debug.") - debugCommand.Flags().BoolVarP(&printInfo, "info", "I", false, "Show metadata about the debug session instead of starting the debugger.") + debugCommand.Flags().StringVarP(&fqbn, "fqbn", "b", "", tr("Fully Qualified Board Name, e.g.: arduino:avr:uno")) + debugCommand.Flags().StringVarP(&port, "port", "p", "", tr("Debug port, e.g.: COM10 or /dev/ttyACM0")) + debugCommand.Flags().StringVarP(&programmer, "programmer", "P", "", tr("Programmer to use for debugging")) + debugCommand.Flags().StringVar(&interpreter, "interpreter", "console", fmt.Sprintf(tr("Debug interpreter e.g.: %s, %s, %s, %s, %s"), "console", "mi", "mi1", "mi2", "mi3")) + debugCommand.Flags().StringVarP(&importDir, "input-dir", "", "", tr("Directory containing binaries for debug.")) + debugCommand.Flags().BoolVarP(&printInfo, "info", "I", false, tr("Show metadata about the debug session instead of starting the debugger.")) return debugCommand } @@ -91,10 +93,10 @@ func run(command *cobra.Command, args []string) { if res, err := debug.GetDebugConfig(context.Background(), debugConfigRequested); err != nil { if status, ok := status.FromError(err); ok { - feedback.Errorf("Error getting Debug info: %v", status.Message()) + feedback.Errorf(tr("Error getting Debug info: %v"), status.Message()) errorcodes.ExitWithGrpcStatus(status) } - feedback.Errorf("Error getting Debug info: %v", err) + feedback.Errorf(tr("Error getting Debug info: %v"), err) os.Exit(errorcodes.ErrGeneric) } else { feedback.PrintResult(&debugInfoResult{res}) @@ -107,7 +109,7 @@ func run(command *cobra.Command, args []string) { signal.Notify(ctrlc, os.Interrupt) if _, err := debug.Debug(context.Background(), debugConfigRequested, os.Stdin, os.Stdout, ctrlc); err != nil { - feedback.Errorf("Error during Debug: %v", err) + feedback.Errorf(tr("Error during Debug: %v"), err) os.Exit(errorcodes.ErrGeneric) } @@ -122,7 +124,7 @@ func initSketchPath(sketchPath *paths.Path) *paths.Path { wd, err := paths.Getwd() if err != nil { - feedback.Errorf("Couldn't get current working directory: %v", err) + feedback.Errorf(tr("Couldn't get current working directory: %v"), err) os.Exit(errorcodes.ErrGeneric) } logrus.Infof("Reading sketch from dir: %s", wd) @@ -141,26 +143,26 @@ func (r *debugInfoResult) String() string { t := table.New() green := color.New(color.FgHiGreen) dimGreen := color.New(color.FgGreen) - t.AddRow("Executable to debug", table.NewCell(r.info.GetExecutable(), green)) - t.AddRow("Toolchain type", table.NewCell(r.info.GetToolchain(), green)) - t.AddRow("Toolchain path", table.NewCell(r.info.GetToolchainPath(), dimGreen)) - t.AddRow("Toolchain prefix", table.NewCell(r.info.GetToolchainPrefix(), dimGreen)) + t.AddRow(tr("Executable to debug"), table.NewCell(r.info.GetExecutable(), green)) + t.AddRow(tr("Toolchain type"), table.NewCell(r.info.GetToolchain(), green)) + t.AddRow(tr("Toolchain path"), table.NewCell(r.info.GetToolchainPath(), dimGreen)) + t.AddRow(tr("Toolchain prefix"), table.NewCell(r.info.GetToolchainPrefix(), dimGreen)) if len(r.info.GetToolchainConfiguration()) > 0 { conf := properties.NewFromHashmap(r.info.GetToolchainConfiguration()) keys := conf.Keys() sort.Strings(keys) - t.AddRow("Toolchain custom configurations") + t.AddRow(tr("Toolchain custom configurations")) for _, k := range keys { t.AddRow(table.NewCell(" - "+k, dimGreen), table.NewCell(conf.Get(k), dimGreen)) } } - t.AddRow("GDB Server type", table.NewCell(r.info.GetServer(), green)) - t.AddRow("GDB Server path", table.NewCell(r.info.GetServerPath(), dimGreen)) + t.AddRow(tr("GDB Server type"), table.NewCell(r.info.GetServer(), green)) + t.AddRow(tr("GDB Server path"), table.NewCell(r.info.GetServerPath(), dimGreen)) if len(r.info.GetServerConfiguration()) > 0 { conf := properties.NewFromHashmap(r.info.GetServerConfiguration()) keys := conf.Keys() sort.Strings(keys) - t.AddRow(fmt.Sprintf("%s custom configurations", r.info.GetServer())) + t.AddRow(fmt.Sprintf(tr("%s custom configurations"), r.info.GetServer())) for _, k := range keys { t.AddRow(table.NewCell(" - "+k, dimGreen), table.NewCell(conf.Get(k), dimGreen)) } diff --git a/cli/feedback/feedback.go b/cli/feedback/feedback.go index c97a5f4c1fe..a7a3a8eb7f7 100644 --- a/cli/feedback/feedback.go +++ b/cli/feedback/feedback.go @@ -22,6 +22,7 @@ import ( "io" "os" + "github.com/arduino/arduino-cli/i18n" "github.com/sirupsen/logrus" "google.golang.org/grpc/status" ) @@ -51,6 +52,8 @@ type Feedback struct { format OutputFormat } +var tr = i18n.Tr + // New creates a Feedback instance func New(out, err io.Writer, format OutputFormat) *Feedback { return &Feedback{ @@ -128,7 +131,7 @@ func (fb *Feedback) Error(v ...interface{}) { // desired output in a pretty JSON format. It adds a newline to the output. func (fb *Feedback) printJSON(v interface{}) { if d, err := json.MarshalIndent(v, "", " "); err != nil { - fb.Errorf("Error during JSON encoding of the output: %v", err) + fb.Errorf(tr("Error during JSON encoding of the output: %v"), err) } else { fmt.Fprintf(fb.out, "%v\n", string(d)) } diff --git a/cli/generatedocs/generatedocs.go b/cli/generatedocs/generatedocs.go index 8bf2e7bb3f8..41f9852ae6d 100644 --- a/cli/generatedocs/generatedocs.go +++ b/cli/generatedocs/generatedocs.go @@ -20,25 +20,29 @@ import ( "path/filepath" "github.com/arduino/arduino-cli/cli/errorcodes" + "github.com/arduino/arduino-cli/i18n" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/cobra/doc" ) -var outputDir = "" +var ( + outputDir = "" + tr = i18n.Tr +) // NewCommand created a new `generatedocs` command func NewCommand() *cobra.Command { command := &cobra.Command{ Use: "generate-docs", - Short: "Generates bash completion and command manpages.", - Long: "Generates bash completion and command manpages.", + Short: tr("Generates bash completion and command manpages."), + Long: tr("Generates bash completion and command manpages."), Example: " " + os.Args[0] + " generate-docs bash-completions", Hidden: true, } command.PersistentFlags().StringVarP(&outputDir, "output-dir", "o", "", - "Directory where to save generated files. Default is './docs', the directory must exist.") + tr("Directory where to save generated files. Default is './docs', the directory must exist.")) command.AddCommand(&cobra.Command{ Use: "manpage", Args: cobra.NoArgs, @@ -72,7 +76,7 @@ func generateManPages(cmd *cobra.Command, args []string) { } logrus.WithField("outputDir", outputDir).Info("Generating manpages") header := &doc.GenManHeader{ - Title: "ARDUINO COMMAND LINE MANUAL", + Title: tr("ARDUINO COMMAND LINE MANUAL"), Section: "1", } err := doc.GenManTree(cmd.Root(), header, outputDir) diff --git a/cli/globals/args.go b/cli/globals/args.go index 03ac7d4bcd0..a0a5f2fccb1 100644 --- a/cli/globals/args.go +++ b/cli/globals/args.go @@ -55,16 +55,16 @@ func ParseReferenceArgs(args []string, parseArch bool) ([]*ReferenceArg, error) func ParseReferenceArg(arg string, parseArch bool) (*ReferenceArg, error) { ret := &ReferenceArg{} if arg == "" { - return nil, fmt.Errorf("invalid empty core argument") + return nil, fmt.Errorf(tr("invalid empty core argument")) } toks := strings.SplitN(arg, "@", 2) if toks[0] == "" { - return nil, fmt.Errorf("invalid empty core reference '%s'", arg) + return nil, fmt.Errorf(tr("invalid empty core reference '%s'"), arg) } ret.PackageName = toks[0] if len(toks) > 1 { if toks[1] == "" { - return nil, fmt.Errorf("invalid empty core version: '%s'", arg) + return nil, fmt.Errorf(tr("invalid empty core version: '%s'"), arg) } ret.Version = toks[1] } @@ -72,14 +72,14 @@ func ParseReferenceArg(arg string, parseArch bool) (*ReferenceArg, error) { if parseArch { toks = strings.Split(ret.PackageName, ":") if len(toks) != 2 { - return nil, fmt.Errorf("invalid item %s", arg) + return nil, fmt.Errorf(tr("invalid item %s"), arg) } if toks[0] == "" { - return nil, fmt.Errorf("invalid empty core name '%s'", arg) + return nil, fmt.Errorf(tr("invalid empty core name '%s'"), arg) } ret.PackageName = toks[0] if toks[1] == "" { - return nil, fmt.Errorf("invalid empty core architecture '%s'", arg) + return nil, fmt.Errorf(tr("invalid empty core architecture '%s'"), arg) } ret.Architecture = toks[1] } diff --git a/cli/globals/globals.go b/cli/globals/globals.go index 8a73ba08745..fc6811e38e4 100644 --- a/cli/globals/globals.go +++ b/cli/globals/globals.go @@ -19,6 +19,7 @@ import ( "os" "path/filepath" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/version" ) @@ -27,4 +28,5 @@ var ( VersionInfo = version.NewInfo(filepath.Base(os.Args[0])) // DefaultIndexURL is the default index url DefaultIndexURL = "https://downloads.arduino.cc/packages/package_index.json" + tr = i18n.Tr ) diff --git a/cli/instance/instance.go b/cli/instance/instance.go index 9ce34b5e70f..2e09f34fa8b 100644 --- a/cli/instance/instance.go +++ b/cli/instance/instance.go @@ -24,12 +24,15 @@ import ( "github.com/arduino/arduino-cli/cli/output" "github.com/arduino/arduino-cli/commands" "github.com/arduino/arduino-cli/configuration" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/arduino/go-paths-helper" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) +var tr = i18n.Tr + // CreateAndInit return a new initialized instance. // If Create fails the CLI prints an error and exits since // to execute further operations a valid Instance is mandatory. @@ -37,11 +40,11 @@ import ( func CreateAndInit() *rpc.Instance { instance, err := Create() if err != nil { - feedback.Errorf("Error creating instance: %v", err) + feedback.Errorf(tr("Error creating instance: %v"), err) os.Exit(errorcodes.ErrGeneric) } for _, err := range Init(instance) { - feedback.Errorf("Error initializing instance: %v", err) + feedback.Errorf(tr("Error initializing instance: %v"), err) } return instance } diff --git a/cli/lib/args.go b/cli/lib/args.go index 7d9cc00f38f..306e0aca5b4 100644 --- a/cli/lib/args.go +++ b/cli/lib/args.go @@ -46,12 +46,12 @@ func ParseLibraryReferenceArg(arg string) (*LibraryReferenceArg, error) { // TODO: check library Name constraints // TODO: check library Version constraints if tokens[0] == "" { - return nil, fmt.Errorf("invalid empty library name") + return nil, fmt.Errorf(tr("invalid empty library name")) } ret.Name = tokens[0] if len(tokens) > 1 { if tokens[1] == "" { - return nil, fmt.Errorf("invalid empty library version: %s", arg) + return nil, fmt.Errorf(tr("invalid empty library version: %s"), arg) } ret.Version = tokens[1] } diff --git a/cli/lib/check_deps.go b/cli/lib/check_deps.go index 1f19c5e58ca..05056634bb3 100644 --- a/cli/lib/check_deps.go +++ b/cli/lib/check_deps.go @@ -31,12 +31,12 @@ import ( func initDepsCommand() *cobra.Command { depsCommand := &cobra.Command{ - Use: "deps LIBRARY[@VERSION_NUMBER](S)", - Short: "Check dependencies status for the specified library.", - Long: "Check dependencies status for the specified library.", + Use: fmt.Sprintf("deps %s[@%s]...", tr("LIBRARY"), tr("VERSION_NUMBER")), + Short: tr("Check dependencies status for the specified library."), + Long: tr("Check dependencies status for the specified library."), Example: "" + - " " + os.Args[0] + " lib deps AudioZero # for the latest version.\n" + - " " + os.Args[0] + " lib deps AudioZero@1.0.0 # for the specific version.", + " " + os.Args[0] + " lib deps AudioZero # " + tr("for the latest version.") + "\n" + + " " + os.Args[0] + " lib deps AudioZero@1.0.0 # " + tr("for the specific version."), Args: cobra.ExactArgs(1), Run: runDepsCommand, } @@ -47,7 +47,7 @@ func runDepsCommand(cmd *cobra.Command, args []string) { instance := instance.CreateAndInit() libRef, err := ParseLibraryReferenceArgAndAdjustCase(instance, args[0]) if err != nil { - feedback.Errorf("Arguments error: %v", err) + feedback.Errorf(tr("Arguments error: %v"), err) os.Exit(errorcodes.ErrBadArgument) } @@ -57,7 +57,7 @@ func runDepsCommand(cmd *cobra.Command, args []string) { Version: libRef.Version, }) if err != nil { - feedback.Errorf("Error resolving dependencies for %s: %s", libRef, err) + feedback.Errorf(tr("Error resolving dependencies for %[1]s: %[2]s"), libRef, err) } feedback.PrintResult(&checkDepResult{deps: deps}) @@ -87,13 +87,13 @@ func outputDep(dep *rpc.LibraryDependencyStatus) string { red := color.New(color.FgRed) yellow := color.New(color.FgYellow) if dep.GetVersionInstalled() == "" { - res += fmt.Sprintf("%s must be installed.\n", + res += fmt.Sprintf(tr("%s must be installed.")+"\n", red.Sprintf("✕ %s %s", dep.GetName(), dep.GetVersionRequired())) } else if dep.GetVersionInstalled() == dep.GetVersionRequired() { - res += fmt.Sprintf("%s is already installed.\n", + res += fmt.Sprintf(tr("%s is already installed.")+"\n", green.Sprintf("✓ %s %s", dep.GetName(), dep.GetVersionRequired())) } else { - res += fmt.Sprintf("%s is required but %s is currently installed.\n", + res += fmt.Sprintf(tr("%s is required but %s is currently installed.")+"\n", yellow.Sprintf("✕ %s %s", dep.GetName(), dep.GetVersionRequired()), yellow.Sprintf("%s", dep.GetVersionInstalled())) } diff --git a/cli/lib/download.go b/cli/lib/download.go index b65a4991b73..861fa0592d7 100644 --- a/cli/lib/download.go +++ b/cli/lib/download.go @@ -17,6 +17,7 @@ package lib import ( "context" + "fmt" "os" "github.com/arduino/arduino-cli/cli/errorcodes" @@ -30,12 +31,12 @@ import ( func initDownloadCommand() *cobra.Command { downloadCommand := &cobra.Command{ - Use: "download [LIBRARY_NAME(S)]", - Short: "Downloads one or more libraries without installing them.", - Long: "Downloads one or more libraries without installing them.", + Use: fmt.Sprintf("download [%s]...", tr("LIBRARY_NAME")), + Short: tr("Downloads one or more libraries without installing them."), + Long: tr("Downloads one or more libraries without installing them."), Example: "" + - " " + os.Args[0] + " lib download AudioZero # for the latest version.\n" + - " " + os.Args[0] + " lib download AudioZero@1.0.0 # for a specific version.", + " " + os.Args[0] + " lib download AudioZero # " + tr("for the latest version.") + "\n" + + " " + os.Args[0] + " lib download AudioZero@1.0.0 # " + tr("for a specific version."), Args: cobra.MinimumNArgs(1), Run: runDownloadCommand, } @@ -46,7 +47,7 @@ func runDownloadCommand(cmd *cobra.Command, args []string) { instance := instance.CreateAndInit() refs, err := ParseLibraryReferenceArgsAndAdjustCase(instance, args) if err != nil { - feedback.Errorf("Invalid argument passed: %v", err) + feedback.Errorf(tr("Invalid argument passed: %v"), err) os.Exit(errorcodes.ErrBadArgument) } @@ -58,7 +59,7 @@ func runDownloadCommand(cmd *cobra.Command, args []string) { } _, err := lib.LibraryDownload(context.Background(), libraryDownloadRequest, output.ProgressBar()) if err != nil { - feedback.Errorf("Error downloading %s: %v", library, err) + feedback.Errorf(tr("Error downloading %[1]s: %[2]v"), library, err) os.Exit(errorcodes.ErrNetwork) } } diff --git a/cli/lib/examples.go b/cli/lib/examples.go index 7a7ae76606c..5026b2c3d50 100644 --- a/cli/lib/examples.go +++ b/cli/lib/examples.go @@ -35,14 +35,14 @@ import ( func initExamplesCommand() *cobra.Command { examplesCommand := &cobra.Command{ - Use: "examples [LIBRARY_NAME]", - Short: "Shows the list of the examples for libraries.", - Long: "Shows the list of the examples for libraries. A name may be given as argument to search a specific library.", + Use: fmt.Sprintf("examples [%s]", tr("LIBRARY_NAME")), + Short: tr("Shows the list of the examples for libraries."), + Long: tr("Shows the list of the examples for libraries. A name may be given as argument to search a specific library."), Example: " " + os.Args[0] + " lib examples Wire", Args: cobra.MaximumNArgs(1), Run: runExamplesCommand, } - examplesCommand.Flags().StringVarP(&examplesFlags.fqbn, "fqbn", "b", "", "Show libraries for the specified board FQBN.") + examplesCommand.Flags().StringVarP(&examplesFlags.fqbn, "fqbn", "b", "", tr("Show libraries for the specified board FQBN.")) return examplesCommand } @@ -66,7 +66,7 @@ func runExamplesCommand(cmd *cobra.Command, args []string) { Fqbn: examplesFlags.fqbn, }) if err != nil { - feedback.Errorf("Error getting libraries info: %v", err) + feedback.Errorf(tr("Error getting libraries info: %v"), err) os.Exit(errorcodes.ErrGeneric) } @@ -100,7 +100,7 @@ func (ir libraryExamplesResult) Data() interface{} { func (ir libraryExamplesResult) String() string { if ir.Examples == nil || len(ir.Examples) == 0 { - return "No libraries found." + return tr("No libraries found.") } sort.Slice(ir.Examples, func(i, j int) bool { @@ -115,7 +115,7 @@ func (ir libraryExamplesResult) String() string { } else if lib.Library.Location != rpc.LibraryLocation_LIBRARY_LOCATION_USER { name += " (" + lib.Library.GetLocation().String() + ")" } - r := fmt.Sprintf("Examples for library %s\n", color.GreenString("%s", name)) + r := fmt.Sprintf(tr("Examples for library %s")+"\n", color.GreenString("%s", name)) sort.Slice(lib.Examples, func(i, j int) bool { return strings.ToLower(lib.Examples[i]) < strings.ToLower(lib.Examples[j]) }) diff --git a/cli/lib/install.go b/cli/lib/install.go index db494c8b9a0..21b37d9ed5d 100644 --- a/cli/lib/install.go +++ b/cli/lib/install.go @@ -35,20 +35,20 @@ import ( func initInstallCommand() *cobra.Command { installCommand := &cobra.Command{ - Use: "install LIBRARY[@VERSION_NUMBER](S)", - Short: "Installs one or more specified libraries into the system.", - Long: "Installs one or more specified libraries into the system.", + Use: fmt.Sprintf("install %s[@%s]...", tr("LIBRARY"), tr("VERSION_NUMBER")), + Short: tr("Installs one or more specified libraries into the system."), + Long: tr("Installs one or more specified libraries into the system."), Example: "" + - " " + os.Args[0] + " lib install AudioZero # for the latest version.\n" + - " " + os.Args[0] + " lib install AudioZero@1.0.0 # for the specific version.\n" + + " " + os.Args[0] + " lib install AudioZero # " + tr("for the latest version.") + "\n" + + " " + os.Args[0] + " lib install AudioZero@1.0.0 # " + tr("for the specific version.") + "\n" + " " + os.Args[0] + " lib install --git-url https://github.com/arduino-libraries/WiFi101.git https://github.com/arduino-libraries/ArduinoBLE.git\n" + " " + os.Args[0] + " lib install --zip-path /path/to/WiFi101.zip /path/to/ArduinoBLE.zip\n", Args: cobra.MinimumNArgs(1), Run: runInstallCommand, } - installCommand.Flags().BoolVar(&installFlags.noDeps, "no-deps", false, "Do not install dependencies.") - installCommand.Flags().BoolVar(&installFlags.gitURL, "git-url", false, "Enter git url for libraries hosted on repositories") - installCommand.Flags().BoolVar(&installFlags.zipPath, "zip-path", false, "Enter a path to zip file") + installCommand.Flags().BoolVar(&installFlags.noDeps, "no-deps", false, tr("Do not install dependencies.")) + installCommand.Flags().BoolVar(&installFlags.gitURL, "git-url", false, tr("Enter git url for libraries hosted on repositories")) + installCommand.Flags().BoolVar(&installFlags.zipPath, "zip-path", false, tr("Enter a path to zip file")) return installCommand } @@ -68,10 +68,10 @@ func runInstallCommand(cmd *cobra.Command, args []string) { split := strings.Split(globals.VersionInfo.VersionString, ".") documentationURL = fmt.Sprintf("https://arduino.github.io/arduino-cli/%s.%s/configuration/#configuration-keys", split[0], split[1]) } - feedback.Errorf("--git-url and --zip-path are disabled by default, for more information see: %v", documentationURL) + feedback.Errorf(tr("--git-url and --zip-path are disabled by default, for more information see: %v"), documentationURL) os.Exit(errorcodes.ErrGeneric) } - feedback.Print("--git-url and --zip-path flags allow installing untrusted files, use it at your own risk.") + feedback.Print(tr("--git-url and --zip-path flags allow installing untrusted files, use it at your own risk.")) } if installFlags.zipPath { @@ -82,7 +82,7 @@ func runInstallCommand(cmd *cobra.Command, args []string) { Overwrite: true, }, output.TaskProgress()) if err != nil { - feedback.Errorf("Error installing Zip Library: %v", err) + feedback.Errorf(tr("Error installing Zip Library: %v"), err) os.Exit(errorcodes.ErrGeneric) } } @@ -94,7 +94,7 @@ func runInstallCommand(cmd *cobra.Command, args []string) { if url == "." { wd, err := paths.Getwd() if err != nil { - feedback.Errorf("Couldn't get current working directory: %v", err) + feedback.Errorf(tr("Couldn't get current working directory: %v"), err) os.Exit(errorcodes.ErrGeneric) } url = wd.String() @@ -105,7 +105,7 @@ func runInstallCommand(cmd *cobra.Command, args []string) { Overwrite: true, }, output.TaskProgress()) if err != nil { - feedback.Errorf("Error installing Git Library: %v", err) + feedback.Errorf(tr("Error installing Git Library: %v"), err) os.Exit(errorcodes.ErrGeneric) } } @@ -114,7 +114,7 @@ func runInstallCommand(cmd *cobra.Command, args []string) { libRefs, err := ParseLibraryReferenceArgsAndAdjustCase(instance, args) if err != nil { - feedback.Errorf("Arguments error: %v", err) + feedback.Errorf(tr("Arguments error: %v"), err) os.Exit(errorcodes.ErrBadArgument) } @@ -127,7 +127,7 @@ func runInstallCommand(cmd *cobra.Command, args []string) { } err := lib.LibraryInstall(context.Background(), libraryInstallRequest, output.ProgressBar(), output.TaskProgress()) if err != nil { - feedback.Errorf("Error installing %s: %v", libRef.Name, err) + feedback.Errorf(tr("Error installing %s: %v"), libRef.Name, err) os.Exit(errorcodes.ErrGeneric) } } diff --git a/cli/lib/lib.go b/cli/lib/lib.go index 149e2a24837..c6cdbb59b58 100644 --- a/cli/lib/lib.go +++ b/cli/lib/lib.go @@ -18,15 +18,18 @@ package lib import ( "os" + "github.com/arduino/arduino-cli/i18n" "github.com/spf13/cobra" ) +var tr = i18n.Tr + // NewCommand created a new `lib` command func NewCommand() *cobra.Command { libCommand := &cobra.Command{ Use: "lib", - Short: "Arduino commands about libraries.", - Long: "Arduino commands about libraries.", + Short: tr("Arduino commands about libraries."), + Long: tr("Arduino commands about libraries."), Example: "" + " " + os.Args[0] + " lib install AudioZero\n" + " " + os.Args[0] + " lib update-index", diff --git a/cli/lib/list.go b/cli/lib/list.go index edc34846bef..1be49dec77f 100644 --- a/cli/lib/list.go +++ b/cli/lib/list.go @@ -16,6 +16,7 @@ package lib import ( + "fmt" "os" "sort" "strings" @@ -33,19 +34,20 @@ import ( func initListCommand() *cobra.Command { listCommand := &cobra.Command{ - Use: "list [LIBNAME]", - Short: "Shows a list of installed libraries.", - Long: "Shows a list of installed libraries.\n\n" + - "If the LIBNAME parameter is specified the listing is limited to that specific\n" + - "library. By default the libraries provided as built-in by platforms/core are\n" + - "not listed, they can be listed by adding the --all flag.", + Use: fmt.Sprintf("list [%s]", tr("LIBNAME")), + Short: tr("Shows a list of installed libraries."), + Long: tr(`Shows a list of installed libraries. + +If the LIBNAME parameter is specified the listing is limited to that specific +library. By default the libraries provided as built-in by platforms/core are +not listed, they can be listed by adding the --all flag.`), Example: " " + os.Args[0] + " lib list", Args: cobra.MaximumNArgs(1), Run: runListCommand, } - listCommand.Flags().BoolVar(&listFlags.all, "all", false, "Include built-in libraries (from platforms and IDE) in listing.") - listCommand.Flags().StringVarP(&listFlags.fqbn, "fqbn", "b", "", "Show libraries for the specified board FQBN.") - listCommand.Flags().BoolVar(&listFlags.updatable, "updatable", false, "List updatable libraries.") + listCommand.Flags().BoolVar(&listFlags.all, "all", false, tr("Include built-in libraries (from platforms and IDE) in listing.")) + listCommand.Flags().StringVarP(&listFlags.fqbn, "fqbn", "b", "", tr("Show libraries for the specified board FQBN.")) + listCommand.Flags().BoolVar(&listFlags.updatable, "updatable", false, tr("List updatable libraries.")) return listCommand } @@ -72,7 +74,7 @@ func runListCommand(cmd *cobra.Command, args []string) { Fqbn: listFlags.fqbn, }) if err != nil { - feedback.Errorf("Error listing Libraries: %v", err) + feedback.Errorf(tr("Error listing Libraries: %v"), err) os.Exit(errorcodes.ErrGeneric) } @@ -110,9 +112,9 @@ func (ir installedResult) Data() interface{} { func (ir installedResult) String() string { if ir.installedLibs == nil || len(ir.installedLibs) == 0 { if listFlags.updatable { - return "No updates available." + return tr("No updates available.") } - return "No libraries installed." + return tr("No libraries installed.") } sort.Slice(ir.installedLibs, func(i, j int) bool { return strings.ToLower(ir.installedLibs[i].Library.Name) < strings.ToLower(ir.installedLibs[j].Library.Name) || @@ -120,7 +122,7 @@ func (ir installedResult) String() string { }) t := table.New() - t.SetHeader("Name", "Installed", "Available", "Location", "Description") + t.SetHeader(tr("Name"), tr("Installed"), tr("Available"), tr("Location"), tr("Description")) t.SetColumnWidthMode(1, table.Average) t.SetColumnWidthMode(2, table.Average) t.SetColumnWidthMode(4, table.Average) diff --git a/cli/lib/search.go b/cli/lib/search.go index fb6d240724e..de6251d7cf9 100644 --- a/cli/lib/search.go +++ b/cli/lib/search.go @@ -36,14 +36,14 @@ import ( func initSearchCommand() *cobra.Command { searchCommand := &cobra.Command{ - Use: "search [LIBRARY_NAME]", - Short: "Searches for one or more libraries data.", - Long: "Search for one or more libraries data (case insensitive search).", + Use: fmt.Sprintf("search [%s]", tr("LIBRARY_NAME")), + Short: tr("Searches for one or more libraries data."), + Long: tr("Search for one or more libraries data (case insensitive search)."), Example: " " + os.Args[0] + " lib search audio", Args: cobra.ArbitraryArgs, Run: runSearchCommand, } - searchCommand.Flags().BoolVar(&searchFlags.namesOnly, "names", false, "Show library names only.") + searchCommand.Flags().BoolVar(&searchFlags.namesOnly, "names", false, tr("Show library names only.")) return searchCommand } @@ -54,7 +54,7 @@ var searchFlags struct { func runSearchCommand(cmd *cobra.Command, args []string) { inst, status := instance.Create() if status != nil { - feedback.Errorf("Error creating instance: %v", status) + feedback.Errorf(tr("Error creating instance: %v"), status) os.Exit(errorcodes.ErrGeneric) } @@ -62,12 +62,12 @@ func runSearchCommand(cmd *cobra.Command, args []string) { Instance: inst, }, output.ProgressBar()) if err != nil { - feedback.Errorf("Error updating library index: %v", err) + feedback.Errorf(tr("Error updating library index: %v"), err) os.Exit(errorcodes.ErrGeneric) } for _, err := range instance.Init(inst) { - feedback.Errorf("Error initializing instance: %v", err) + feedback.Errorf(tr("Error initializing instance: %v"), err) } logrus.Info("Executing `arduino lib search`") @@ -76,7 +76,7 @@ func runSearchCommand(cmd *cobra.Command, args []string) { Query: (strings.Join(args, " ")), }) if err != nil { - feedback.Errorf("Error searching for Library: %v", err) + feedback.Errorf(tr("Error searching for Library: %v"), err) os.Exit(errorcodes.ErrGeneric) } @@ -122,7 +122,7 @@ func (res result) Data() interface{} { func (res result) String() string { results := res.results.GetLibraries() if len(results) == 0 { - return "No libraries matching your search." + return tr("No libraries matching your search.") } // get a sorted slice of results @@ -133,12 +133,12 @@ func (res result) String() string { var out strings.Builder if res.results.GetStatus() == rpc.LibrarySearchStatus_LIBRARY_SEARCH_STATUS_FAILED { - out.WriteString("No libraries matching your search.\nDid you mean...\n") + out.WriteString(tr("No libraries matching your search.\nDid you mean...\n")) } for _, lib := range results { if res.results.GetStatus() == rpc.LibrarySearchStatus_LIBRARY_SEARCH_STATUS_SUCCESS { - out.WriteString(fmt.Sprintf("Name: \"%s\"\n", lib.Name)) + out.WriteString(fmt.Sprintf(tr(`Name: "%s"`)+"\n", lib.Name)) if res.namesOnly { continue } @@ -158,23 +158,23 @@ func (res result) String() string { } } - out.WriteString(fmt.Sprintf(" Author: %s\n", latest.Author)) - out.WriteString(fmt.Sprintf(" Maintainer: %s\n", latest.Maintainer)) - out.WriteString(fmt.Sprintf(" Sentence: %s\n", latest.Sentence)) - out.WriteString(fmt.Sprintf(" Paragraph: %s\n", latest.Paragraph)) - out.WriteString(fmt.Sprintf(" Website: %s\n", latest.Website)) + out.WriteString(fmt.Sprintf(" "+tr("Author: %s")+"\n", latest.Author)) + out.WriteString(fmt.Sprintf(" "+tr("Maintainer: %s")+"\n", latest.Maintainer)) + out.WriteString(fmt.Sprintf(" "+tr("Sentence: %s")+"\n", latest.Sentence)) + out.WriteString(fmt.Sprintf(" "+tr("Paragraph: %s")+"\n", latest.Paragraph)) + out.WriteString(fmt.Sprintf(" "+tr("Website: %s")+"\n", latest.Website)) if latest.License != "" { - out.WriteString(fmt.Sprintf(" License: %s\n", latest.License)) + out.WriteString(fmt.Sprintf(" "+tr("License: %s")+"\n", latest.License)) } - out.WriteString(fmt.Sprintf(" Category: %s\n", latest.Category)) - out.WriteString(fmt.Sprintf(" Architecture: %s\n", strings.Join(latest.Architectures, ", "))) - out.WriteString(fmt.Sprintf(" Types: %s\n", strings.Join(latest.Types, ", "))) - out.WriteString(fmt.Sprintf(" Versions: %s\n", strings.Replace(fmt.Sprint(versionsFromSearchedLibrary(lib)), " ", ", ", -1))) + out.WriteString(fmt.Sprintf(" "+tr("Category: %s")+"\n", latest.Category)) + out.WriteString(fmt.Sprintf(" "+tr("Architecture: %s")+"\n", strings.Join(latest.Architectures, ", "))) + out.WriteString(fmt.Sprintf(" "+tr("Types: %s")+"\n", strings.Join(latest.Types, ", "))) + out.WriteString(fmt.Sprintf(" "+tr("Versions: %s")+"\n", strings.Replace(fmt.Sprint(versionsFromSearchedLibrary(lib)), " ", ", ", -1))) if len(latest.ProvidesIncludes) > 0 { - out.WriteString(fmt.Sprintf(" Provides includes: %s\n", strings.Join(latest.ProvidesIncludes, ", "))) + out.WriteString(fmt.Sprintf(" "+tr("Provides includes: %s")+"\n", strings.Join(latest.ProvidesIncludes, ", "))) } if len(latest.Dependencies) > 0 { - out.WriteString(fmt.Sprintf(" Dependencies: %s\n", strings.Join(deps, ", "))) + out.WriteString(fmt.Sprintf(" "+tr("Dependencies: %s")+"\n", strings.Join(deps, ", "))) } } diff --git a/cli/lib/uninstall.go b/cli/lib/uninstall.go index f904f06d000..1a00da8a557 100644 --- a/cli/lib/uninstall.go +++ b/cli/lib/uninstall.go @@ -17,6 +17,7 @@ package lib import ( "context" + "fmt" "os" "github.com/arduino/arduino-cli/cli/errorcodes" @@ -31,9 +32,9 @@ import ( func initUninstallCommand() *cobra.Command { uninstallCommand := &cobra.Command{ - Use: "uninstall LIBRARY_NAME(S)", - Short: "Uninstalls one or more libraries.", - Long: "Uninstalls one or more libraries.", + Use: fmt.Sprintf("uninstall %s...", tr("LIBRARY_NAME")), + Short: tr("Uninstalls one or more libraries."), + Long: tr("Uninstalls one or more libraries."), Example: " " + os.Args[0] + " lib uninstall AudioZero", Args: cobra.MinimumNArgs(1), Run: runUninstallCommand, @@ -47,7 +48,7 @@ func runUninstallCommand(cmd *cobra.Command, args []string) { instance := instance.CreateAndInit() refs, err := ParseLibraryReferenceArgsAndAdjustCase(instance, args) if err != nil { - feedback.Errorf("Invalid argument passed: %v", err) + feedback.Errorf(tr("Invalid argument passed: %v"), err) os.Exit(errorcodes.ErrBadArgument) } @@ -58,7 +59,7 @@ func runUninstallCommand(cmd *cobra.Command, args []string) { Version: library.Version, }, output.TaskProgress()) if err != nil { - feedback.Errorf("Error uninstalling %s: %v", library, err) + feedback.Errorf(tr("Error uninstalling %[1]s: %[2]v"), library, err) os.Exit(errorcodes.ErrGeneric) } } diff --git a/cli/lib/update_index.go b/cli/lib/update_index.go index f92b13b5bd6..e5df0a3213a 100644 --- a/cli/lib/update_index.go +++ b/cli/lib/update_index.go @@ -31,8 +31,8 @@ import ( func initUpdateIndexCommand() *cobra.Command { return &cobra.Command{ Use: "update-index", - Short: "Updates the libraries index.", - Long: "Updates the libraries index to the latest version.", + Short: tr("Updates the libraries index."), + Long: tr("Updates the libraries index to the latest version."), Example: " " + os.Args[0] + " lib update-index", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { @@ -42,7 +42,7 @@ func initUpdateIndexCommand() *cobra.Command { // as argument but none would be obviously found. inst, status := instance.Create() if status != nil { - feedback.Errorf("Error creating instance: %v", status) + feedback.Errorf(tr("Error creating instance: %v"), status) os.Exit(errorcodes.ErrGeneric) } @@ -51,7 +51,7 @@ func initUpdateIndexCommand() *cobra.Command { // we must use instance.Create instead of instance.CreateAndInit for the // reason stated above. if err := instance.FirstUpdate(inst); err != nil { - feedback.Errorf("Error updating indexes: %v", status) + feedback.Errorf(tr("Error updating indexes: %v"), status) os.Exit(errorcodes.ErrGeneric) } @@ -59,7 +59,7 @@ func initUpdateIndexCommand() *cobra.Command { Instance: inst, }, output.ProgressBar()) if err != nil { - feedback.Errorf("Error updating library index: %v", err) + feedback.Errorf(tr("Error updating library index: %v"), err) os.Exit(errorcodes.ErrGeneric) } }, diff --git a/cli/lib/upgrade.go b/cli/lib/upgrade.go index 27f1827e751..c1f417f62b8 100644 --- a/cli/lib/upgrade.go +++ b/cli/lib/upgrade.go @@ -30,10 +30,8 @@ import ( func initUpgradeCommand() *cobra.Command { listCommand := &cobra.Command{ Use: "upgrade", - Short: "Upgrades installed libraries.", - Long: "This command upgrades an installed library to the latest available version. " + - "Multiple libraries can be passed separated by a space. If no arguments are provided, " + - "the command will upgrade all the installed libraries where an update is available.", + Short: tr("Upgrades installed libraries."), + Long: tr("This command upgrades an installed library to the latest available version. Multiple libraries can be passed separated by a space. If no arguments are provided, the command will upgrade all the installed libraries where an update is available."), Example: " " + os.Args[0] + " lib upgrade \n" + " " + os.Args[0] + " lib upgrade Audio\n" + " " + os.Args[0] + " lib upgrade Audio ArduinoJson", @@ -49,13 +47,13 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) { if len(args) == 0 { err := lib.LibraryUpgradeAll(instance.Id, output.ProgressBar(), output.TaskProgress()) if err != nil { - feedback.Errorf("Error upgrading libraries: %v", err) + feedback.Errorf(tr("Error upgrading libraries: %v"), err) os.Exit(errorcodes.ErrGeneric) } } else { err := lib.LibraryUpgrade(instance.Id, args, output.ProgressBar(), output.TaskProgress()) if err != nil { - feedback.Errorf("Error upgrading libraries: %v", err) + feedback.Errorf(tr("Error upgrading libraries: %v"), err) os.Exit(errorcodes.ErrGeneric) } } diff --git a/cli/outdated/outdated.go b/cli/outdated/outdated.go index 20d8a50f94b..11be3cdba5b 100644 --- a/cli/outdated/outdated.go +++ b/cli/outdated/outdated.go @@ -22,19 +22,22 @@ import ( "github.com/arduino/arduino-cli/cli/feedback" "github.com/arduino/arduino-cli/cli/instance" "github.com/arduino/arduino-cli/commands" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/arduino/arduino-cli/table" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) +var tr = i18n.Tr + // NewCommand creates a new `outdated` command func NewCommand() *cobra.Command { outdatedCommand := &cobra.Command{ Use: "outdated", - Short: "Lists cores and libraries that can be upgraded", - Long: "This commands shows a list of installed cores and/or libraries\n" + - "that can be upgraded. If nothing needs to be updated the output is empty.", + Short: tr("Lists cores and libraries that can be upgraded"), + Long: tr(`This commands shows a list of installed cores and/or libraries +that can be upgraded. If nothing needs to be updated the output is empty.`), Example: " " + os.Args[0] + " outdated\n", Args: cobra.NoArgs, Run: runOutdatedCommand, @@ -51,12 +54,12 @@ func runOutdatedCommand(cmd *cobra.Command, args []string) { Instance: inst, }) if err != nil { - feedback.Errorf("Error retrieving outdated cores and libraries: %v", err) + feedback.Errorf(tr("Error retrieving outdated cores and libraries: %v"), err) } // Prints outdated cores tab := table.New() - tab.SetHeader("Core name", "Installed version", "New version") + tab.SetHeader(tr("Core name"), tr("Installed version"), tr("New version")) if len(outdatedResp.OutdatedPlatforms) > 0 { for _, p := range outdatedResp.OutdatedPlatforms { tab.AddRow(p.Name, p.Installed, p.Latest) @@ -66,7 +69,7 @@ func runOutdatedCommand(cmd *cobra.Command, args []string) { // Prints outdated libraries tab = table.New() - tab.SetHeader("Library name", "Installed version", "New version") + tab.SetHeader(tr("Library name"), tr("Installed version"), tr("New version")) if len(outdatedResp.OutdatedLibraries) > 0 { for _, l := range outdatedResp.OutdatedLibraries { tab.AddRow(l.Library.Name, l.Library.Version, l.Release.Version) diff --git a/cli/output/rpc_progress.go b/cli/output/rpc_progress.go index 07a92123a56..a5e1f5614a0 100644 --- a/cli/output/rpc_progress.go +++ b/cli/output/rpc_progress.go @@ -19,12 +19,16 @@ import ( "fmt" "github.com/arduino/arduino-cli/commands" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/cmaglie/pb" ) -// OutputFormat can be "text" or "json" -var OutputFormat string +var ( + // OutputFormat can be "text" or "json" + OutputFormat string + tr = i18n.Tr +) // ProgressBar returns a DownloadProgressCB that prints a progress bar. // If JSON output format has been selected, the callback outputs nothing. @@ -57,7 +61,7 @@ func NewDownloadProgressBarCB() func(*rpc.DownloadProgress) { // fmt.Printf(">>> %v\n", curr) if filename := curr.GetFile(); filename != "" { if curr.GetCompleted() { - fmt.Println(filename + " already downloaded") + fmt.Printf(tr("%s already downloaded")+"\n", filename) return } prefix = filename @@ -69,7 +73,7 @@ func NewDownloadProgressBarCB() func(*rpc.DownloadProgress) { bar.Set(int(curr.GetDownloaded())) } if curr.GetCompleted() { - bar.FinishPrintOver(prefix + " downloaded") + bar.FinishPrintOver(fmt.Sprintf(tr("%s downloaded"), prefix)) } } } diff --git a/cli/sketch/archive.go b/cli/sketch/archive.go index 4b7c07b03dc..538ee22f374 100644 --- a/cli/sketch/archive.go +++ b/cli/sketch/archive.go @@ -17,6 +17,7 @@ package sketch import ( "context" + "fmt" "os" "github.com/arduino/arduino-cli/arduino/sketch" @@ -34,9 +35,9 @@ var includeBuildDir bool // initArchiveCommand creates a new `archive` command func initArchiveCommand() *cobra.Command { command := &cobra.Command{ - Use: "archive ", - Short: "Creates a zip file containing all sketch files.", - Long: "Creates a zip file containing all sketch files.", + Use: fmt.Sprintf("archive <%s> <%s>", tr("sketchPath"), tr("archivePath")), + Short: tr("Creates a zip file containing all sketch files."), + Long: tr("Creates a zip file containing all sketch files."), Example: "" + " " + os.Args[0] + " archive\n" + " " + os.Args[0] + " archive .\n" + @@ -47,7 +48,7 @@ func initArchiveCommand() *cobra.Command { Run: runArchiveCommand, } - command.Flags().BoolVar(&includeBuildDir, "include-build-dir", false, "Includes build directory in the archive.") + command.Flags().BoolVar(&includeBuildDir, "include-build-dir", false, fmt.Sprintf(tr("Includes %s directory in the archive."), "build")) return command } @@ -62,7 +63,7 @@ func runArchiveCommand(cmd *cobra.Command, args []string) { // .pde files are still supported but deprecated, this warning urges the user to rename them if files := sketch.CheckForPdeFiles(sketchPath); len(files) > 0 { - feedback.Error("Sketches with .pde extension are deprecated, please rename the following files to .ino:") + feedback.Error(tr("Sketches with .pde extension are deprecated, please rename the following files to .ino:")) for _, f := range files { feedback.Error(f) } @@ -81,7 +82,7 @@ func runArchiveCommand(cmd *cobra.Command, args []string) { }) if err != nil { - feedback.Errorf("Error archiving: %v", err) + feedback.Errorf(tr("Error archiving: %v"), err) os.Exit(errorcodes.ErrGeneric) } } diff --git a/cli/sketch/new.go b/cli/sketch/new.go index b9154853e59..4227132ae57 100644 --- a/cli/sketch/new.go +++ b/cli/sketch/new.go @@ -29,8 +29,8 @@ import ( func initNewCommand() *cobra.Command { newCommand := &cobra.Command{ Use: "new", - Short: "Create a new Sketch", - Long: "Create a new Sketch", + Short: tr("Create a new Sketch"), + Long: tr("Create a new Sketch"), Example: " " + os.Args[0] + " sketch new MultiBlinker", Args: cobra.ExactArgs(1), Run: runNewCommand, @@ -51,19 +51,19 @@ func runNewCommand(cmd *cobra.Command, args []string) { trimmedSketchName := strings.TrimSuffix(args[0], ".ino") sketchDir, err := filepath.Abs(trimmedSketchName) if err != nil { - feedback.Errorf("Error creating sketch: %v", err) + feedback.Errorf(tr("Error creating sketch: %v"), err) os.Exit(errorcodes.ErrGeneric) } if err := os.MkdirAll(sketchDir, os.FileMode(0755)); err != nil { - feedback.Errorf("Could not create sketch directory: %v", err) + feedback.Errorf(tr("Could not create sketch directory: %v"), err) os.Exit(errorcodes.ErrGeneric) } sketchName := filepath.Base(sketchDir) sketchFile := filepath.Join(sketchDir, sketchName+".ino") if err := ioutil.WriteFile(sketchFile, emptySketch, os.FileMode(0644)); err != nil { - feedback.Errorf("Error creating sketch: %v", err) + feedback.Errorf(tr("Error creating sketch: %v"), err) os.Exit(errorcodes.ErrGeneric) } - feedback.Print("Sketch created in: " + sketchDir) + feedback.Printf(tr("Sketch created in: %s"), sketchDir) } diff --git a/cli/sketch/sketch.go b/cli/sketch/sketch.go index 90e0f4c2fa0..2155ae16af1 100644 --- a/cli/sketch/sketch.go +++ b/cli/sketch/sketch.go @@ -18,15 +18,18 @@ package sketch import ( "os" + "github.com/arduino/arduino-cli/i18n" "github.com/spf13/cobra" ) +var tr = i18n.Tr + // NewCommand created a new `sketch` command func NewCommand() *cobra.Command { cmd := &cobra.Command{ Use: "sketch", - Short: "Arduino CLI sketch commands.", - Long: "Arduino CLI sketch commands.", + Short: tr("Arduino CLI sketch commands."), + Long: tr("Arduino CLI sketch commands."), Example: " " + os.Args[0] + " sketch new MySketch", } diff --git a/cli/update/update.go b/cli/update/update.go index 50fd04a6afe..ba7e1b876ff 100644 --- a/cli/update/update.go +++ b/cli/update/update.go @@ -24,23 +24,26 @@ import ( "github.com/arduino/arduino-cli/cli/instance" "github.com/arduino/arduino-cli/cli/output" "github.com/arduino/arduino-cli/commands" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/arduino/arduino-cli/table" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) +var tr = i18n.Tr + // NewCommand creates a new `update` command func NewCommand() *cobra.Command { updateCommand := &cobra.Command{ Use: "update", - Short: "Updates the index of cores and libraries", - Long: "Updates the index of cores and libraries to the latest versions.", + Short: tr("Updates the index of cores and libraries"), + Long: tr("Updates the index of cores and libraries to the latest versions."), Example: " " + os.Args[0] + " update", Args: cobra.NoArgs, Run: runUpdateCommand, } - updateCommand.Flags().BoolVar(&updateFlags.showOutdated, "show-outdated", false, "Show outdated cores and libraries after index update") + updateCommand.Flags().BoolVar(&updateFlags.showOutdated, "show-outdated", false, tr("Show outdated cores and libraries after index update")) return updateCommand } @@ -56,7 +59,7 @@ func runUpdateCommand(cmd *cobra.Command, args []string) { // as argument but none would be obviously found. inst, status := instance.Create() if status != nil { - feedback.Errorf("Error creating instance: %v", status) + feedback.Errorf(tr("Error creating instance: %v"), status) os.Exit(errorcodes.ErrGeneric) } @@ -65,7 +68,7 @@ func runUpdateCommand(cmd *cobra.Command, args []string) { // we must use instance.Create instead of instance.CreateAndInit for the // reason stated above. if err := instance.FirstUpdate(inst); err != nil { - feedback.Errorf("Error updating indexes: %v", status) + feedback.Errorf(tr("Error updating indexes: %v"), status) os.Exit(errorcodes.ErrGeneric) } @@ -73,7 +76,7 @@ func runUpdateCommand(cmd *cobra.Command, args []string) { Instance: inst, }, output.ProgressBar()) if err != nil { - feedback.Errorf("Error updating core and libraries index: %v", err) + feedback.Errorf(tr("Error updating core and libraries index: %v"), err) os.Exit(errorcodes.ErrGeneric) } @@ -81,19 +84,19 @@ func runUpdateCommand(cmd *cobra.Command, args []string) { // To show outdated platforms and libraries we need to initialize our instance // otherwise nothing would be shown for _, err := range instance.Init(inst) { - feedback.Errorf("Error initializing instance: %v", err) + feedback.Errorf(tr("Error initializing instance: %v"), err) } outdatedResp, err := commands.Outdated(context.Background(), &rpc.OutdatedRequest{ Instance: inst, }) if err != nil { - feedback.Errorf("Error retrieving outdated cores and libraries: %v", err) + feedback.Errorf(tr("Error retrieving outdated cores and libraries: %v"), err) } // Prints outdated cores tab := table.New() - tab.SetHeader("Core name", "Installed version", "New version") + tab.SetHeader(tr("Core name"), tr("Installed version"), tr("New version")) if len(outdatedResp.OutdatedPlatforms) > 0 { for _, p := range outdatedResp.OutdatedPlatforms { tab.AddRow(p.Name, p.Installed, p.Latest) @@ -103,7 +106,7 @@ func runUpdateCommand(cmd *cobra.Command, args []string) { // Prints outdated libraries tab = table.New() - tab.SetHeader("Library name", "Installed version", "New version") + tab.SetHeader(tr("Library name"), tr("Installed version"), tr("New version")) if len(outdatedResp.OutdatedLibraries) > 0 { for _, l := range outdatedResp.OutdatedLibraries { tab.AddRow(l.Library.Name, l.Library.Version, l.Release.Version) diff --git a/cli/upgrade/upgrade.go b/cli/upgrade/upgrade.go index a9ee2e68d55..b6920169167 100644 --- a/cli/upgrade/upgrade.go +++ b/cli/upgrade/upgrade.go @@ -24,17 +24,20 @@ import ( "github.com/arduino/arduino-cli/cli/instance" "github.com/arduino/arduino-cli/cli/output" "github.com/arduino/arduino-cli/commands" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) +var tr = i18n.Tr + // NewCommand creates a new `upgrade` command func NewCommand() *cobra.Command { upgradeCommand := &cobra.Command{ Use: "upgrade", - Short: "Upgrades installed cores and libraries.", - Long: "Upgrades installed cores and libraries to latest version.", + Short: tr("Upgrades installed cores and libraries."), + Long: tr("Upgrades installed cores and libraries to latest version."), Example: " " + os.Args[0] + " upgrade", Args: cobra.NoArgs, Run: runUpgradeCommand, @@ -54,7 +57,7 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) { }, output.NewDownloadProgressBarCB(), output.TaskProgress()) if err != nil { - feedback.Errorf("Error upgrading: %v", err) + feedback.Errorf(tr("Error upgrading: %v"), err) } logrus.Info("Done") diff --git a/cli/upload/upload.go b/cli/upload/upload.go index 7d0f69f6b52..55513eef0f1 100644 --- a/cli/upload/upload.go +++ b/cli/upload/upload.go @@ -17,6 +17,7 @@ package upload import ( "context" + "fmt" "os" "github.com/arduino/arduino-cli/arduino/sketch" @@ -24,6 +25,7 @@ import ( "github.com/arduino/arduino-cli/cli/feedback" "github.com/arduino/arduino-cli/cli/instance" "github.com/arduino/arduino-cli/commands/upload" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/arduino/go-paths-helper" "github.com/sirupsen/logrus" @@ -39,35 +41,36 @@ var ( importFile string programmer string dryRun bool + tr = i18n.Tr ) // NewCommand created a new `upload` command func NewCommand() *cobra.Command { uploadCommand := &cobra.Command{ Use: "upload", - Short: "Upload Arduino sketches.", - Long: "Upload Arduino sketches. This does NOT compile the sketch prior to upload.", + Short: tr("Upload Arduino sketches."), + Long: tr("Upload Arduino sketches. This does NOT compile the sketch prior to upload."), Example: " " + os.Args[0] + " upload /home/user/Arduino/MySketch", Args: cobra.MaximumNArgs(1), PreRun: checkFlagsConflicts, Run: run, } - uploadCommand.Flags().StringVarP(&fqbn, "fqbn", "b", "", "Fully Qualified Board Name, e.g.: arduino:avr:uno") - uploadCommand.Flags().StringVarP(&port, "port", "p", "", "Upload port, e.g.: COM10 or /dev/ttyACM0") - uploadCommand.Flags().StringVarP(&importDir, "input-dir", "", "", "Directory containing binaries to upload.") - uploadCommand.Flags().StringVarP(&importFile, "input-file", "i", "", "Binary file to upload.") - uploadCommand.Flags().BoolVarP(&verify, "verify", "t", false, "Verify uploaded binary after the upload.") - uploadCommand.Flags().BoolVarP(&verbose, "verbose", "v", false, "Optional, turns on verbose mode.") - uploadCommand.Flags().StringVarP(&programmer, "programmer", "P", "", "Optional, use the specified programmer to upload.") - uploadCommand.Flags().BoolVar(&dryRun, "dry-run", false, "Do not perform the actual upload, just log out actions") + uploadCommand.Flags().StringVarP(&fqbn, "fqbn", "b", "", tr("Fully Qualified Board Name, e.g.: arduino:avr:uno")) + uploadCommand.Flags().StringVarP(&port, "port", "p", "", tr("Upload port, e.g.: COM10 or /dev/ttyACM0")) + uploadCommand.Flags().StringVarP(&importDir, "input-dir", "", "", tr("Directory containing binaries to upload.")) + uploadCommand.Flags().StringVarP(&importFile, "input-file", "i", "", tr("Binary file to upload.")) + uploadCommand.Flags().BoolVarP(&verify, "verify", "t", false, tr("Verify uploaded binary after the upload.")) + uploadCommand.Flags().BoolVarP(&verbose, "verbose", "v", false, tr("Optional, turns on verbose mode.")) + uploadCommand.Flags().StringVarP(&programmer, "programmer", "P", "", tr("Optional, use the specified programmer to upload.")) + uploadCommand.Flags().BoolVar(&dryRun, "dry-run", false, tr("Do not perform the actual upload, just log out actions")) uploadCommand.Flags().MarkHidden("dry-run") return uploadCommand } func checkFlagsConflicts(command *cobra.Command, args []string) { if importFile != "" && importDir != "" { - feedback.Errorf("error: --input-file and --input-dir flags cannot be used together") + feedback.Errorf(fmt.Sprintf(tr("error: %s and %s flags cannot be used together"), "--input-file", "--input-dir")) os.Exit(errorcodes.ErrBadArgument) } } @@ -83,7 +86,7 @@ func run(command *cobra.Command, args []string) { // .pde files are still supported but deprecated, this warning urges the user to rename them if files := sketch.CheckForPdeFiles(sketchPath); len(files) > 0 { - feedback.Error("Sketches with .pde extension are deprecated, please rename the following files to .ino:") + feedback.Error(tr("Sketches with .pde extension are deprecated, please rename the following files to .ino:")) for _, f := range files { feedback.Error(f) } @@ -101,7 +104,7 @@ func run(command *cobra.Command, args []string) { Programmer: programmer, DryRun: dryRun, }, os.Stdout, os.Stderr); err != nil { - feedback.Errorf("Error during Upload: %v", err) + feedback.Errorf(tr("Error during Upload: %v"), err) os.Exit(errorcodes.ErrGeneric) } } @@ -114,7 +117,7 @@ func initSketchPath(sketchPath *paths.Path) *paths.Path { wd, err := paths.Getwd() if err != nil { - feedback.Errorf("Couldn't get current working directory: %v", err) + feedback.Errorf(tr("Couldn't get current working directory: %v"), err) os.Exit(errorcodes.ErrGeneric) } logrus.Infof("Reading sketch from dir: %s", wd) diff --git a/cli/version/version.go b/cli/version/version.go index 8c08c809569..e6c0132e85b 100644 --- a/cli/version/version.go +++ b/cli/version/version.go @@ -20,15 +20,18 @@ import ( "github.com/arduino/arduino-cli/cli/feedback" "github.com/arduino/arduino-cli/cli/globals" + "github.com/arduino/arduino-cli/i18n" "github.com/spf13/cobra" ) +var tr = i18n.Tr + // NewCommand created a new `version` command func NewCommand() *cobra.Command { return &cobra.Command{ Use: "version", - Short: "Shows version number of Arduino CLI.", - Long: "Shows the version number of Arduino CLI which is installed on your system.", + Short: tr("Shows version number of Arduino CLI."), + Long: tr("Shows the version number of Arduino CLI which is installed on your system."), Example: " " + os.Args[0] + " version", Args: cobra.NoArgs, Run: run, diff --git a/commands/board/attach.go b/commands/board/attach.go index 32b8e2e53a8..4c9ba46e13f 100644 --- a/commands/board/attach.go +++ b/commands/board/attach.go @@ -27,16 +27,19 @@ import ( "github.com/arduino/arduino-cli/arduino/cores/packagemanager" "github.com/arduino/arduino-cli/arduino/sketch" "github.com/arduino/arduino-cli/commands" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" discovery "github.com/arduino/board-discovery" "github.com/arduino/go-paths-helper" ) +var tr = i18n.Tr + // Attach FIXMEDOC func Attach(ctx context.Context, req *rpc.BoardAttachRequest, taskCB commands.TaskProgressCB) (*rpc.BoardAttachResponse, error) { pm := commands.GetPackageManager(req.GetInstance().GetId()) if pm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } var sketchPath *paths.Path if req.GetSketchPath() != "" { @@ -44,7 +47,7 @@ func Attach(ctx context.Context, req *rpc.BoardAttachRequest, taskCB commands.Ta } sk, err := sketch.New(sketchPath) if err != nil { - return nil, fmt.Errorf("opening sketch: %s", err) + return nil, fmt.Errorf(tr("opening sketch: %s"), err) } boardURI := req.GetBoardUri() @@ -60,7 +63,7 @@ func Attach(ctx context.Context, req *rpc.BoardAttachRequest, taskCB commands.Ta } else { deviceURI, err := url.Parse(boardURI) if err != nil { - return nil, fmt.Errorf("invalid Device URL format: %s", err) + return nil, fmt.Errorf(tr("invalid Device URL format: %s"), err) } var findBoardFunc func(*packagemanager.PackageManager, *discovery.Monitor, *url.URL) *cores.Board @@ -70,7 +73,7 @@ func Attach(ctx context.Context, req *rpc.BoardAttachRequest, taskCB commands.Ta case "http", "https", "tcp", "udp": findBoardFunc = findNetworkConnectedBoard default: - return nil, fmt.Errorf("invalid device port type provided") + return nil, fmt.Errorf(tr("invalid device port type provided")) } duration, err := time.ParseDuration(req.GetSearchTimeout()) @@ -86,9 +89,9 @@ func Attach(ctx context.Context, req *rpc.BoardAttachRequest, taskCB commands.Ta // TODO: Handle the case when no board is found. board := findBoardFunc(pm, monitor, deviceURI) if board == nil { - return nil, fmt.Errorf("no supported board found at %s", deviceURI.String()) + return nil, fmt.Errorf(tr("no supported board found at %s"), deviceURI.String()) } - taskCB(&rpc.TaskProgress{Name: "Board found: " + board.Name()}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Board found: %s"), board.Name())}) // TODO: should be stoped the monitor: when running as a pure CLI is released // by the OS, when run as daemon the resource's state is unknown and could be leaked. @@ -101,9 +104,9 @@ func Attach(ctx context.Context, req *rpc.BoardAttachRequest, taskCB commands.Ta err = sk.ExportMetadata() if err != nil { - return nil, fmt.Errorf("cannot export sketch metadata: %s", err) + return nil, fmt.Errorf(tr("cannot export sketch metadata: %s"), err) } - taskCB(&rpc.TaskProgress{Name: "Selected fqbn: " + sk.Metadata.CPU.Fqbn, Completed: true}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Selected fqbn: %s"), sk.Metadata.CPU.Fqbn), Completed: true}) return &rpc.BoardAttachResponse{}, nil } diff --git a/commands/board/details.go b/commands/board/details.go index 9046aa3d528..5b8909300a2 100644 --- a/commands/board/details.go +++ b/commands/board/details.go @@ -30,18 +30,18 @@ import ( func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetailsResponse, error) { pm := commands.GetPackageManager(req.GetInstance().GetId()) if pm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } fqbn, err := cores.ParseFQBN(req.GetFqbn()) if err != nil { - return nil, fmt.Errorf("parsing fqbn: %s", err) + return nil, fmt.Errorf(tr("parsing fqbn: %s"), err) } boardPackage, boardPlatform, board, boardProperties, boardRefPlatform, err := pm.ResolveFQBN(fqbn) if err != nil { - return nil, fmt.Errorf("loading board data: %s", err) + return nil, fmt.Errorf(tr("loading board data: %s"), err) } details := &rpc.BoardDetailsResponse{} diff --git a/commands/board/list.go b/commands/board/list.go index 79cecd691d2..e518fd9cd79 100644 --- a/commands/board/list.go +++ b/commands/board/list.go @@ -37,7 +37,7 @@ import ( var ( // ErrNotFound is returned when the API returns 404 - ErrNotFound = errors.New("board not found") + ErrNotFound = errors.New(tr("board not found")) m sync.Mutex vidPidURL = "https://builder.arduino.cc/v3/boards/byVidPid" validVidPid = regexp.MustCompile(`0[xX][a-fA-F\d]{4}`) @@ -46,10 +46,10 @@ var ( func apiByVidPid(vid, pid string) ([]*rpc.BoardListItem, error) { // ensure vid and pid are valid before hitting the API if !validVidPid.MatchString(vid) { - return nil, errors.Errorf("Invalid vid value: '%s'", vid) + return nil, errors.Errorf(tr("Invalid vid value: '%s'"), vid) } if !validVidPid.MatchString(pid) { - return nil, errors.Errorf("Invalid pid value: '%s'", pid) + return nil, errors.Errorf(tr("Invalid pid value: '%s'"), pid) } url := fmt.Sprintf("%s/%s/%s", vidPidURL, vid, pid) @@ -62,7 +62,7 @@ func apiByVidPid(vid, pid string) ([]*rpc.BoardListItem, error) { httpClient, err := httpclient.New() if err != nil { - return nil, errors.Wrap(err, "failed to initialize http client") + return nil, errors.Wrap(err, tr("failed to initialize http client")) } if res, err := httpClient.Do(req); err == nil { @@ -70,7 +70,7 @@ func apiByVidPid(vid, pid string) ([]*rpc.BoardListItem, error) { if res.StatusCode == 404 { return nil, ErrNotFound } - return nil, errors.Errorf("the server responded with status %s", res.Status) + return nil, errors.Errorf(tr("the server responded with status %s"), res.Status) } body, _ := ioutil.ReadAll(res.Body) @@ -79,14 +79,14 @@ func apiByVidPid(vid, pid string) ([]*rpc.BoardListItem, error) { var dat map[string]interface{} err = json.Unmarshal(body, &dat) if err != nil { - return nil, errors.Wrap(err, "error processing response from server") + return nil, errors.Wrap(err, tr("error processing response from server")) } name, nameFound := dat["name"].(string) fqbn, fbqnFound := dat["fqbn"].(string) if !nameFound || !fbqnFound { - return nil, errors.New("wrong format in server response") + return nil, errors.New(tr("wrong format in server response")) } retVal = append(retVal, &rpc.BoardListItem{ @@ -96,7 +96,7 @@ func apiByVidPid(vid, pid string) ([]*rpc.BoardListItem, error) { Pid: pid, }) } else { - return nil, errors.Wrap(err, "error querying Arduino Cloud Api") + return nil, errors.Wrap(err, tr("error querying Arduino Cloud Api")) } return retVal, nil @@ -142,7 +142,7 @@ func identify(pm *packagemanager.PackageManager, port *discovery.Port) ([]*rpc.B logrus.Debug("Board not recognized") } else if err != nil { // this is bad, bail out - return nil, errors.Wrap(err, "error getting board info from Arduino Cloud") + return nil, errors.Wrap(err, tr("error getting board info from Arduino Cloud")) } // add a DetectedPort entry in any case: the `Boards` field will @@ -190,12 +190,12 @@ func List(instanceID int32) (r []*rpc.DetectedPort, e error) { pm := commands.GetPackageManager(instanceID) if pm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } ports, err := commands.ListBoards(pm) if err != nil { - return nil, errors.Wrap(err, "error getting port list from serial-discovery") + return nil, errors.Wrap(err, fmt.Sprintf(tr("error getting port list from %s"), "serial-discovery")) } retVal := []*rpc.DetectedPort{} diff --git a/commands/board/listall.go b/commands/board/listall.go index e2766854564..f2cca87693b 100644 --- a/commands/board/listall.go +++ b/commands/board/listall.go @@ -33,7 +33,7 @@ const maximumSearchDistance = 20 func ListAll(ctx context.Context, req *rpc.BoardListAllRequest) (*rpc.BoardListAllResponse, error) { pm := commands.GetPackageManager(req.GetInstance().GetId()) if pm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } searchArgs := []string{} diff --git a/commands/board/search.go b/commands/board/search.go index 0750d3e0cc9..41c2b049371 100644 --- a/commands/board/search.go +++ b/commands/board/search.go @@ -33,7 +33,7 @@ import ( func Search(ctx context.Context, req *rpc.BoardSearchRequest) (*rpc.BoardSearchResponse, error) { pm := commands.GetPackageManager(req.GetInstance().GetId()) if pm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } searchArgs := strings.Split(strings.Trim(req.SearchArgs, " "), " ") diff --git a/commands/bundled_tools.go b/commands/bundled_tools.go index 66cc66c61c3..9fcb17ed137 100644 --- a/commands/bundled_tools.go +++ b/commands/bundled_tools.go @@ -42,19 +42,19 @@ func InstallToolRelease(pm *packagemanager.PackageManager, toolRelease *cores.To if toolRelease.IsInstalled() { log.Warn("Tool already installed") - taskCB(&rpc.TaskProgress{Name: "Tool " + toolRelease.String() + " already installed", Completed: true}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Tool %s already installed"), toolRelease), Completed: true}) return nil } log.Info("Installing tool") - taskCB(&rpc.TaskProgress{Name: "Installing " + toolRelease.String()}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Installing %s"), toolRelease)}) err := pm.InstallTool(toolRelease) if err != nil { log.WithError(err).Warn("Cannot install tool") - return fmt.Errorf("installing tool %s: %s", toolRelease, err) + return fmt.Errorf(tr("installing tool %[1]s: %[2]s"), toolRelease, err) } log.Info("Tool installed") - taskCB(&rpc.TaskProgress{Message: toolRelease.String() + " installed", Completed: true}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("%s installed"), toolRelease), Completed: true}) return nil } diff --git a/commands/bundled_tools_ctags.go b/commands/bundled_tools_ctags.go index 4e1ad24445f..f37a835da41 100644 --- a/commands/bundled_tools_ctags.go +++ b/commands/bundled_tools_ctags.go @@ -19,9 +19,12 @@ import ( "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/arduino/cores/packagemanager" "github.com/arduino/arduino-cli/arduino/resources" + "github.com/arduino/arduino-cli/i18n" semver "go.bug.st/relaxed-semver" ) +var tr = i18n.Tr + func getBuiltinCtagsTool(pm *packagemanager.PackageManager) *cores.ToolRelease { builtinPackage := pm.Packages.GetOrCreatePackage("builtin") ctagsTool := builtinPackage.GetOrCreateTool("ctags") diff --git a/commands/bundled_tools_serial_discovery.go b/commands/bundled_tools_serial_discovery.go index 4c76b89f05c..d484251de7a 100644 --- a/commands/bundled_tools_serial_discovery.go +++ b/commands/bundled_tools_serial_discovery.go @@ -116,7 +116,7 @@ func ListBoards(pm *packagemanager.PackageManager) ([]*discovery.Port, error) { // determine if it's installed if !t.IsInstalled() { - return nil, fmt.Errorf("missing serial-discovery tool") + return nil, fmt.Errorf(tr("missing serial-discovery tool")) } disc, err := discovery.New("serial-discovery", t.InstallDir.Join(t.Tool.Name).String()) @@ -126,16 +126,16 @@ func ListBoards(pm *packagemanager.PackageManager) ([]*discovery.Port, error) { defer disc.Quit() if err = disc.Run(); err != nil { - return nil, fmt.Errorf("starting discovery: %v", err) + return nil, fmt.Errorf(tr("starting discovery: %v"), err) } if err = disc.Start(); err != nil { - return nil, fmt.Errorf("starting discovery: %v", err) + return nil, fmt.Errorf(tr("starting discovery: %v"), err) } res, err := disc.List() if err != nil { - return nil, fmt.Errorf("getting port list from discovery: %v", err) + return nil, fmt.Errorf(tr("getting port list from discovery: %v"), err) } return res, nil @@ -145,7 +145,7 @@ func ListBoards(pm *packagemanager.PackageManager) ([]*discovery.Port, error) { func WatchListBoards(pm *packagemanager.PackageManager) (<-chan *discovery.Event, error) { t := getBuiltinSerialDiscoveryTool(pm) if !t.IsInstalled() { - return nil, fmt.Errorf("missing serial-discovery tool") + return nil, fmt.Errorf(tr("missing serial-discovery tool")) } disc, err := discovery.New("serial-discovery", t.InstallDir.Join(t.Tool.Name).String()) @@ -154,15 +154,15 @@ func WatchListBoards(pm *packagemanager.PackageManager) (<-chan *discovery.Event } if err = disc.Run(); err != nil { - return nil, fmt.Errorf("starting discovery: %v", err) + return nil, fmt.Errorf(tr("starting discovery: %v"), err) } if err = disc.Start(); err != nil { - return nil, fmt.Errorf("starting discovery: %v", err) + return nil, fmt.Errorf(tr("starting discovery: %v"), err) } if err = disc.StartSync(); err != nil { - return nil, fmt.Errorf("starting sync: %v", err) + return nil, fmt.Errorf(tr("starting sync: %v"), err) } return disc.EventChannel(10), nil diff --git a/commands/compile/compile.go b/commands/compile/compile.go index 4a884e600ca..ab41d31c329 100644 --- a/commands/compile/compile.go +++ b/commands/compile/compile.go @@ -30,8 +30,9 @@ import ( "github.com/arduino/arduino-cli/arduino/sketch" "github.com/arduino/arduino-cli/commands" "github.com/arduino/arduino-cli/configuration" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/legacy/builder" - "github.com/arduino/arduino-cli/legacy/builder/i18n" + legacyi18n "github.com/arduino/arduino-cli/legacy/builder/i18n" "github.com/arduino/arduino-cli/legacy/builder/types" "github.com/arduino/arduino-cli/metrics" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" @@ -42,6 +43,8 @@ import ( "github.com/sirupsen/logrus" ) +var tr = i18n.Tr + // Compile FIXMEDOC func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream io.Writer, debug bool) (r *rpc.CompileResponse, e error) { @@ -87,17 +90,17 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream pm := commands.GetPackageManager(req.GetInstance().GetId()) if pm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } logrus.Tracef("Compile %s for %s started", req.GetSketchPath(), req.GetFqbn()) if req.GetSketchPath() == "" { - return nil, fmt.Errorf("missing sketchPath") + return nil, fmt.Errorf(tr("missing sketchPath")) } sketchPath := paths.New(req.GetSketchPath()) sk, err := sketch.New(sketchPath) if err != nil { - return nil, fmt.Errorf("opening sketch: %s", err) + return nil, fmt.Errorf(tr("opening sketch: %s"), err) } fqbnIn := req.GetFqbn() @@ -105,11 +108,11 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream fqbnIn = sk.Metadata.CPU.Fqbn } if fqbnIn == "" { - return nil, fmt.Errorf("no FQBN provided") + return nil, fmt.Errorf(tr("no FQBN provided")) } fqbn, err := cores.ParseFQBN(fqbnIn) if err != nil { - return nil, fmt.Errorf("incorrect FQBN: %s", err) + return nil, fmt.Errorf(tr("incorrect FQBN: %s"), err) } targetPlatform := pm.FindPlatform(&packagemanager.PlatformReference{ @@ -122,7 +125,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream // "\"%[1]s:%[2]s\" platform is not installed, please install it by running \""+ // version.GetAppName()+" core install %[1]s:%[2]s\".", fqbn.Package, fqbn.PlatformArch) // feedback.Error(errorMessage) - return nil, fmt.Errorf("platform not installed") + return nil, fmt.Errorf(tr("platform not installed")) } builderCtx := &types.Context{} @@ -145,7 +148,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream builderCtx.BuildPath = paths.New(req.GetBuildPath()) } if err = builderCtx.BuildPath.MkdirAll(); err != nil { - return nil, fmt.Errorf("cannot create build directory: %s", err) + return nil, fmt.Errorf(tr("cannot create build directory: %s"), err) } builderCtx.CompilationDatabase = bldr.NewCompilationDatabase( builderCtx.BuildPath.Join("compile_commands.json"), @@ -175,7 +178,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream builderCtx.BuildCachePath = paths.New(req.GetBuildCachePath()) err = builderCtx.BuildCachePath.MkdirAll() if err != nil { - return nil, fmt.Errorf("cannot create build cache directory: %s", err) + return nil, fmt.Errorf(tr("cannot create build cache directory: %s"), err) } } @@ -203,7 +206,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream builderCtx.ExecStdout = outStream builderCtx.ExecStderr = errStream - builderCtx.SetLogger(i18n.LoggerToCustomStreams{Stdout: outStream, Stderr: errStream}) + builderCtx.SetLogger(legacyi18n.LoggerToCustomStreams{Stdout: outStream, Stderr: errStream}) builderCtx.Clean = req.GetClean() builderCtx.OnlyUpdateCompilationDatabase = req.GetCreateCompilationDatabaseOnly() @@ -247,17 +250,17 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream } logrus.WithField("path", exportPath).Trace("Saving sketch to export path.") if err := exportPath.MkdirAll(); err != nil { - return r, errors.Wrap(err, "creating output dir") + return r, errors.Wrap(err, tr("creating output dir")) } // Copy all "sketch.ino.*" artifacts to the export directory baseName, ok := builderCtx.BuildProperties.GetOk("build.project_name") // == "sketch.ino" if !ok { - return r, errors.New("missing 'build.project_name' build property") + return r, errors.New(tr("missing 'build.project_name' build property")) } buildFiles, err := builderCtx.BuildPath.ReadDir() if err != nil { - return r, errors.Errorf("reading build directory: %s", err) + return r, errors.Errorf(tr("reading build directory: %s"), err) } buildFiles.FilterPrefix(baseName) for _, buildFile := range buildFiles { @@ -267,7 +270,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream WithField("dest", exportedFile). Trace("Copying artifact.") if err = buildFile.CopyTo(exportedFile); err != nil { - return r, errors.Wrapf(err, "copying output file %s", buildFile) + return r, errors.Wrapf(err, tr("copying output file %s"), buildFile) } } } @@ -276,7 +279,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream for _, lib := range builderCtx.ImportedLibraries { rpcLib, err := lib.ToRPCLibrary() if err != nil { - return r, fmt.Errorf("converting library %s to rpc struct: %w", lib.Name, err) + return r, fmt.Errorf(tr("converting library %[1]s to rpc struct: %[2]w"), lib.Name, err) } importedLibs = append(importedLibs, rpcLib) } diff --git a/commands/core/download.go b/commands/core/download.go index ffa062e2112..36c46b3dbaf 100644 --- a/commands/core/download.go +++ b/commands/core/download.go @@ -23,19 +23,22 @@ import ( "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/arduino/cores/packagemanager" "github.com/arduino/arduino-cli/commands" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" ) +var tr = i18n.Tr + // PlatformDownload FIXMEDOC func PlatformDownload(ctx context.Context, req *rpc.PlatformDownloadRequest, downloadCB commands.DownloadProgressCB) (*rpc.PlatformDownloadResponse, error) { pm := commands.GetPackageManager(req.GetInstance().GetId()) if pm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } version, err := commands.ParseVersion(req) if err != nil { - return nil, fmt.Errorf("invalid version: %s", err) + return nil, fmt.Errorf(tr("invalid version: %s"), err) } platform, tools, err := pm.FindPlatformReleaseDependencies(&packagemanager.PlatformReference{ @@ -44,7 +47,7 @@ func PlatformDownload(ctx context.Context, req *rpc.PlatformDownloadRequest, dow PlatformVersion: version, }) if err != nil { - return nil, fmt.Errorf("find platform dependencies: %s", err) + return nil, fmt.Errorf(tr("find platform dependencies: %s"), err) } err = downloadPlatform(pm, platform, downloadCB) @@ -55,7 +58,7 @@ func PlatformDownload(ctx context.Context, req *rpc.PlatformDownloadRequest, dow for _, tool := range tools { err := downloadTool(pm, tool, downloadCB) if err != nil { - return nil, fmt.Errorf("downloading tool %s: %s", tool, err) + return nil, fmt.Errorf(tr("downloading tool %[1]s: %[2]s"), tool, err) } } @@ -78,7 +81,7 @@ func downloadPlatform(pm *packagemanager.PackageManager, platformRelease *cores. func downloadTool(pm *packagemanager.PackageManager, tool *cores.ToolRelease, downloadCB commands.DownloadProgressCB) error { // Check if tool has a flavor available for the current OS if tool.GetCompatibleFlavour() == nil { - return fmt.Errorf("tool %s not available for the current OS", tool) + return fmt.Errorf(tr("tool %s not available for the current OS"), tool) } return commands.DownloadToolRelease(pm, tool, downloadCB) diff --git a/commands/core/install.go b/commands/core/install.go index e2cf4273575..a7040763800 100644 --- a/commands/core/install.go +++ b/commands/core/install.go @@ -32,12 +32,12 @@ func PlatformInstall(ctx context.Context, req *rpc.PlatformInstallRequest, pm := commands.GetPackageManager(req.GetInstance().GetId()) if pm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } version, err := commands.ParseVersion(req) if err != nil { - return nil, fmt.Errorf("invalid version: %s", err) + return nil, fmt.Errorf(tr("invalid version: %s"), err) } platform, tools, err := pm.FindPlatformReleaseDependencies(&packagemanager.PlatformReference{ @@ -46,7 +46,7 @@ func PlatformInstall(ctx context.Context, req *rpc.PlatformInstallRequest, PlatformVersion: version, }) if err != nil { - return nil, fmt.Errorf("finding platform dependencies: %s", err) + return nil, fmt.Errorf(tr("finding platform dependencies: %s"), err) } err = installPlatform(pm, platform, tools, downloadCB, taskCB, req.GetSkipPostInstall()) @@ -71,21 +71,21 @@ func installPlatform(pm *packagemanager.PackageManager, // Prerequisite checks before install if platformRelease.IsInstalled() { log.Warn("Platform already installed") - taskCB(&rpc.TaskProgress{Name: "Platform " + platformRelease.String() + " already installed", Completed: true}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Platform %s already installed"), platformRelease), Completed: true}) return nil } toolsToInstall := []*cores.ToolRelease{} for _, tool := range requiredTools { if tool.IsInstalled() { log.WithField("tool", tool).Warn("Tool already installed") - taskCB(&rpc.TaskProgress{Name: "Tool " + tool.String() + " already installed", Completed: true}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Tool %s already installed"), tool), Completed: true}) } else { toolsToInstall = append(toolsToInstall, tool) } } // Package download - taskCB(&rpc.TaskProgress{Name: "Downloading packages"}) + taskCB(&rpc.TaskProgress{Name: tr("Downloading packages")}) for _, tool := range toolsToInstall { if err := downloadTool(pm, tool, downloadCB); err != nil { return err @@ -110,11 +110,11 @@ func installPlatform(pm *packagemanager.PackageManager, if installed == nil { // No version of this platform is installed log.Info("Installing platform") - taskCB(&rpc.TaskProgress{Name: "Installing " + platformRelease.String()}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Installing %s"), platformRelease)}) } else { // A platform with a different version is already installed log.Info("Upgrading platform " + installed.String()) - taskCB(&rpc.TaskProgress{Name: "Upgrading " + installed.String() + " with " + platformRelease.String()}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Upgrading %[1]s with %[2]s"), installed, platformRelease)}) platformRef := &packagemanager.PlatformReference{ Package: platformRelease.Platform.Package.Name, PlatformArchitecture: platformRelease.Platform.Architecture, @@ -127,7 +127,7 @@ func installPlatform(pm *packagemanager.PackageManager, var err error _, installedTools, err = pm.FindPlatformReleaseDependencies(platformRef) if err != nil { - return fmt.Errorf("can't find dependencies for platform %s: %w", platformRef, err) + return fmt.Errorf(tr("can't find dependencies for platform %[1]s: %[2]w"), platformRef, err) } } @@ -145,15 +145,15 @@ func installPlatform(pm *packagemanager.PackageManager, // In case of error try to rollback if errUn != nil { log.WithError(errUn).Error("Error upgrading platform.") - taskCB(&rpc.TaskProgress{Message: "Error upgrading platform: " + err.Error()}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Error upgrading platform: %s"), err)}) // Rollback if err := pm.UninstallPlatform(platformRelease); err != nil { log.WithError(err).Error("Error rolling-back changes.") - taskCB(&rpc.TaskProgress{Message: "Error rolling-back changes: " + err.Error()}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Error rolling-back changes: %s"), err)}) } - return fmt.Errorf("upgrading platform: %s", errUn) + return fmt.Errorf(tr("upgrading platform: %s"), errUn) } // Uninstall unused tools @@ -168,16 +168,16 @@ func installPlatform(pm *packagemanager.PackageManager, // Perform post install if !skipPostInstall { log.Info("Running post_install script") - taskCB(&rpc.TaskProgress{Message: "Configuring platform"}) + taskCB(&rpc.TaskProgress{Message: tr("Configuring platform")}) if err := pm.RunPostInstallScript(platformRelease); err != nil { - taskCB(&rpc.TaskProgress{Message: fmt.Sprintf("WARNING: cannot run post install: %s", err)}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("WARNING: cannot run post install: %s"), err)}) } } else { log.Info("Skipping platform configuration (post_install run).") - taskCB(&rpc.TaskProgress{Message: "Skipping platform configuration"}) + taskCB(&rpc.TaskProgress{Message: tr("Skipping platform configuration")}) } log.Info("Platform installed") - taskCB(&rpc.TaskProgress{Message: platformRelease.String() + " installed", Completed: true}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("%s installed"), platformRelease), Completed: true}) return nil } diff --git a/commands/core/list.go b/commands/core/list.go index 708759e7f20..0ac9c9eb38f 100644 --- a/commands/core/list.go +++ b/commands/core/list.go @@ -30,12 +30,12 @@ func GetPlatforms(req *rpc.PlatformListRequest) ([]*rpc.Platform, error) { instanceID := req.Instance.Id i := commands.GetInstance(instanceID) if i == nil { - return nil, errors.Errorf("unable to find an instance with ID: %d", instanceID) + return nil, errors.Errorf(tr("unable to find an instance with ID: %d"), instanceID) } packageManager := i.PackageManager if packageManager == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } res := []*rpc.Platform{} diff --git a/commands/core/search.go b/commands/core/search.go index e6942cd140a..cb2aa0aa659 100644 --- a/commands/core/search.go +++ b/commands/core/search.go @@ -37,7 +37,7 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse allVersions := req.AllVersions pm := commands.GetPackageManager(req.Instance.Id) if pm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } res := []*cores.PlatformRelease{} diff --git a/commands/core/uninstall.go b/commands/core/uninstall.go index 7d7e3fe1b7b..2628c50ff4c 100644 --- a/commands/core/uninstall.go +++ b/commands/core/uninstall.go @@ -30,7 +30,7 @@ import ( func PlatformUninstall(ctx context.Context, req *rpc.PlatformUninstallRequest, taskCB commands.TaskProgressCB) (*rpc.PlatformUninstallResponse, error) { pm := commands.GetPackageManager(req.GetInstance().GetId()) if pm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } ref := &packagemanager.PlatformReference{ @@ -40,12 +40,12 @@ func PlatformUninstall(ctx context.Context, req *rpc.PlatformUninstallRequest, t if ref.PlatformVersion == nil { platform := pm.FindPlatform(ref) if platform == nil { - return nil, fmt.Errorf("platform not found: %s", ref) + return nil, fmt.Errorf(tr("platform not found: %s"), ref) } platformRelease := pm.GetInstalledPlatformRelease(platform) if platformRelease == nil { - return nil, fmt.Errorf("platform not installed: %s", ref) + return nil, fmt.Errorf(tr("platform not installed: %s"), ref) } ref.PlatformVersion = platformRelease.Version @@ -53,7 +53,7 @@ func PlatformUninstall(ctx context.Context, req *rpc.PlatformUninstallRequest, t platform, tools, err := pm.FindPlatformReleaseDependencies(ref) if err != nil { - return nil, fmt.Errorf("finding platform dependencies: %s", err) + return nil, fmt.Errorf(tr("finding platform dependencies: %s"), err) } err = uninstallPlatformRelease(pm, platform, taskCB) @@ -79,7 +79,7 @@ func uninstallPlatformRelease(pm *packagemanager.PackageManager, platformRelease log := pm.Log.WithField("platform", platformRelease) log.Info("Uninstalling platform") - taskCB(&rpc.TaskProgress{Name: "Uninstalling " + platformRelease.String()}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Uninstalling %s"), platformRelease)}) if err := pm.UninstallPlatform(platformRelease); err != nil { log.WithError(err).Error("Error uninstalling") @@ -87,7 +87,7 @@ func uninstallPlatformRelease(pm *packagemanager.PackageManager, platformRelease } log.Info("Platform uninstalled") - taskCB(&rpc.TaskProgress{Message: platformRelease.String() + " uninstalled", Completed: true}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("%s uninstalled"), platformRelease), Completed: true}) return nil } @@ -95,7 +95,7 @@ func uninstallToolRelease(pm *packagemanager.PackageManager, toolRelease *cores. log := pm.Log.WithField("Tool", toolRelease) log.Info("Uninstalling tool") - taskCB(&rpc.TaskProgress{Name: "Uninstalling " + toolRelease.String() + ", tool is no more required"}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Uninstalling %s, tool is no more required"), toolRelease)}) if err := pm.UninstallTool(toolRelease); err != nil { log.WithError(err).Error("Error uninstalling") @@ -103,6 +103,6 @@ func uninstallToolRelease(pm *packagemanager.PackageManager, toolRelease *cores. } log.Info("Tool uninstalled") - taskCB(&rpc.TaskProgress{Message: toolRelease.String() + " uninstalled", Completed: true}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("%s uninstalled"), toolRelease), Completed: true}) return nil } diff --git a/commands/core/upgrade.go b/commands/core/upgrade.go index e3aa68d7f21..d725f669aff 100644 --- a/commands/core/upgrade.go +++ b/commands/core/upgrade.go @@ -28,7 +28,7 @@ import ( var ( // ErrAlreadyLatest is returned when an upgrade is not possible because // already at latest version. - ErrAlreadyLatest = errors.New("platform already at latest version") + ErrAlreadyLatest = errors.New(tr("platform already at latest version")) ) // PlatformUpgrade FIXMEDOC @@ -37,7 +37,7 @@ func PlatformUpgrade(ctx context.Context, req *rpc.PlatformUpgradeRequest, pm := commands.GetPackageManager(req.GetInstance().GetId()) if pm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } // Extract all PlatformReference to platforms that have updates @@ -61,17 +61,17 @@ func upgradePlatform(pm *packagemanager.PackageManager, platformRef *packagemana downloadCB commands.DownloadProgressCB, taskCB commands.TaskProgressCB, skipPostInstall bool) error { if platformRef.PlatformVersion != nil { - return fmt.Errorf("upgrade doesn't accept parameters with version") + return fmt.Errorf(tr("upgrade doesn't accept parameters with version")) } // Search the latest version for all specified platforms platform := pm.FindPlatform(platformRef) if platform == nil { - return fmt.Errorf("platform %s not found", platformRef) + return fmt.Errorf(tr("platform %s not found"), platformRef) } installed := pm.GetInstalledPlatformRelease(platform) if installed == nil { - return fmt.Errorf("platform %s is not installed", platformRef) + return fmt.Errorf(tr("platform %s is not installed"), platformRef) } latest := platform.GetLatestRelease() if !latest.Version.GreaterThan(installed.Version) { @@ -81,7 +81,7 @@ func upgradePlatform(pm *packagemanager.PackageManager, platformRef *packagemana platformRelease, tools, err := pm.FindPlatformReleaseDependencies(platformRef) if err != nil { - return fmt.Errorf("platform %s is not installed", platformRef) + return fmt.Errorf(tr("platform %s is not installed"), platformRef) } err = installPlatform(pm, platformRelease, tools, downloadCB, taskCB, skipPostInstall) if err != nil { diff --git a/commands/daemon/daemon.go b/commands/daemon/daemon.go index 2bc27c1454f..9b4af338ecb 100644 --- a/commands/daemon/daemon.go +++ b/commands/daemon/daemon.go @@ -28,6 +28,7 @@ import ( "github.com/arduino/arduino-cli/commands/lib" "github.com/arduino/arduino-cli/commands/sketch" "github.com/arduino/arduino-cli/commands/upload" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/sirupsen/logrus" ) @@ -38,6 +39,8 @@ type ArduinoCoreServerImpl struct { VersionString string } +var tr = i18n.Tr + // BoardDetails FIXMEDOC func (s *ArduinoCoreServerImpl) BoardDetails(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetailsResponse, error) { return board.Details(ctx, req) @@ -76,7 +79,7 @@ func (s *ArduinoCoreServerImpl) BoardListWatch(stream rpc.ArduinoCoreService_Boa } if msg.Instance == nil { - err = fmt.Errorf("no instance specified") + err = fmt.Errorf(tr("no instance specified")) stream.Send(&rpc.BoardListWatchResponse{ EventType: "error", Error: err.Error(), diff --git a/commands/daemon/debug.go b/commands/daemon/debug.go index c56bb7acf2e..09a441527e3 100644 --- a/commands/daemon/debug.go +++ b/commands/daemon/debug.go @@ -44,7 +44,7 @@ func (s *DebugService) Debug(stream dbg.DebugService_DebugServer) error { // Ensure it's a config message and not data req := msg.GetDebugRequest() if req == nil { - return errors.Errorf("First message must contain debug request, not data") + return errors.Errorf(tr("First message must contain debug request, not data")) } // Launch debug recipe attaching stdin and out to grpc streaming diff --git a/commands/daemon/monitor.go b/commands/daemon/monitor.go index 5db806a5618..d173d39bfc5 100644 --- a/commands/daemon/monitor.go +++ b/commands/daemon/monitor.go @@ -42,7 +42,7 @@ func (s *MonitorService) StreamingOpen(stream rpc.MonitorService_StreamingOpenSe // ensure it's a config message and not data config := msg.GetConfig() if config == nil { - return errors.New("first message must contain monitor configuration, not data") + return errors.New(tr("first message must contain monitor configuration, not data")) } // select which type of monitor we need @@ -69,7 +69,7 @@ func (s *MonitorService) StreamingOpen(stream rpc.MonitorService_StreamingOpenSe if addCfg, ok := config.GetAdditionalConfig().AsMap()["OutputRate"]; !ok { mon = monitors.OpenNullMonitor(100.0) // 100 bytes per second as default } else if outputRate, ok := addCfg.(float64); !ok { - return errors.New("OutputRate in Null monitor must be a float64") + return errors.New(tr("OutputRate in Null monitor must be a float64")) } else { // get the Monitor instance mon = monitors.OpenNullMonitor(outputRate) diff --git a/commands/daemon/settings.go b/commands/daemon/settings.go index ca86e36b054..a219bebbae7 100644 --- a/commands/daemon/settings.go +++ b/commands/daemon/settings.go @@ -105,7 +105,7 @@ func (s *SettingsService) GetValue(ctx context.Context, req *rpc.GetValueRequest } } if !keyExists { - return nil, errors.New("key not found in settings") + return nil, errors.New(tr("key not found in settings")) } b, err := json.Marshal(configuration.Settings.Get(key)) diff --git a/commands/debug/debug.go b/commands/debug/debug.go index 62c95029bb9..4ce0b2e2218 100644 --- a/commands/debug/debug.go +++ b/commands/debug/debug.go @@ -27,12 +27,15 @@ import ( "github.com/arduino/arduino-cli/arduino/cores/packagemanager" "github.com/arduino/arduino-cli/commands" "github.com/arduino/arduino-cli/executils" + "github.com/arduino/arduino-cli/i18n" dbg "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/debug/v1" "github.com/arduino/go-paths-helper" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) +var tr = i18n.Tr + // Debug command launches a debug tool for a sketch. // It also implements streams routing: // gRPC In -> tool stdIn @@ -45,7 +48,7 @@ func Debug(ctx context.Context, req *dbg.DebugConfigRequest, inStream io.Reader, pm := commands.GetPackageManager(req.GetInstance().GetId()) commandLine, err := getCommandLine(req, pm) if err != nil { - return nil, errors.Wrap(err, "Cannot get command line for tool") + return nil, errors.Wrap(err, tr("Cannot get command line for tool")) } for i, arg := range commandLine { @@ -61,7 +64,7 @@ func Debug(ctx context.Context, req *dbg.DebugConfigRequest, inStream io.Reader, cmd, err := executils.NewProcess(commandLine...) if err != nil { - return nil, errors.Wrap(err, "Cannot execute debug tool") + return nil, errors.Wrap(err, tr("Cannot execute debug tool")) } // Get stdIn pipe from tool @@ -128,7 +131,7 @@ func getCommandLine(req *dbg.DebugConfigRequest, pm *packagemanager.PackageManag } gdbPath = paths.New(debugInfo.ToolchainPath).Join(gdbexecutable) default: - return nil, errors.Errorf("unsupported toolchain '%s'", debugInfo.GetToolchain()) + return nil, errors.Errorf(tr("unsupported toolchain '%s'"), debugInfo.GetToolchain()) } add(gdbPath.String()) @@ -167,7 +170,7 @@ func getCommandLine(req *dbg.DebugConfigRequest, pm *packagemanager.PackageManag add(serverCmd) default: - return nil, errors.Errorf("unsupported gdb server '%s'", debugInfo.GetServer()) + return nil, errors.Errorf(tr("unsupported gdb server '%s'"), debugInfo.GetServer()) } // Add executable diff --git a/commands/debug/debug_info.go b/commands/debug/debug_info.go index d3bdf949b02..5e12510a809 100644 --- a/commands/debug/debug_info.go +++ b/commands/debug/debug_info.go @@ -44,12 +44,12 @@ func getDebugProperties(req *debug.DebugConfigRequest, pm *packagemanager.Packag // TODO: make a generic function to extract sketch from request // and remove duplication in commands/compile.go if req.GetSketchPath() == "" { - return nil, fmt.Errorf("missing sketchPath") + return nil, fmt.Errorf(tr("missing sketchPath")) } sketchPath := paths.New(req.GetSketchPath()) sk, err := sketch.New(sketchPath) if err != nil { - return nil, errors.Wrap(err, "opening sketch") + return nil, errors.Wrap(err, tr("opening sketch")) } // XXX Remove this code duplication!! @@ -58,17 +58,17 @@ func getDebugProperties(req *debug.DebugConfigRequest, pm *packagemanager.Packag fqbnIn = sk.Metadata.CPU.Fqbn } if fqbnIn == "" { - return nil, fmt.Errorf("no Fully Qualified Board Name provided") + return nil, fmt.Errorf(tr("no Fully Qualified Board Name provided")) } fqbn, err := cores.ParseFQBN(fqbnIn) if err != nil { - return nil, errors.Wrap(err, "error parsing FQBN") + return nil, errors.Wrap(err, tr("error parsing FQBN")) } // Find target board and board properties _, platformRelease, board, boardProperties, referencedPlatformRelease, err := pm.ResolveFQBN(fqbn) if err != nil { - return nil, errors.Wrap(err, "error resolving FQBN") + return nil, errors.Wrap(err, tr("error resolving FQBN")) } // Build configuration for debug @@ -111,7 +111,7 @@ func getDebugProperties(req *debug.DebugConfigRequest, pm *packagemanager.Packag } else if refP, ok := referencedPlatformRelease.Programmers[req.GetProgrammer()]; ok { toolProperties.Merge(refP.Properties) } else { - return nil, fmt.Errorf("programmer '%s' not found", req.GetProgrammer()) + return nil, fmt.Errorf(tr("programmer '%s' not found"), req.GetProgrammer()) } } @@ -120,10 +120,10 @@ func getDebugProperties(req *debug.DebugConfigRequest, pm *packagemanager.Packag importPath = paths.New(importDir) } if !importPath.Exist() { - return nil, fmt.Errorf("compiled sketch not found in %s", importPath) + return nil, fmt.Errorf(tr("compiled sketch not found in %s"), importPath) } if !importPath.IsDir() { - return nil, fmt.Errorf("expected compiled sketch in directory %s, but is a file instead", importPath) + return nil, fmt.Errorf(tr("expected compiled sketch in directory %s, but is a file instead"), importPath) } toolProperties.SetPath("build.path", importPath) toolProperties.Set("build.project_name", sk.Name+".ino") @@ -146,7 +146,7 @@ func getDebugProperties(req *debug.DebugConfigRequest, pm *packagemanager.Packag } if !debugProperties.ContainsKey("executable") { - return nil, status.Error(codes.Unimplemented, fmt.Sprintf("debugging not supported for board %s", req.GetFqbn())) + return nil, status.Error(codes.Unimplemented, fmt.Sprintf(tr("debugging not supported for board %s"), req.GetFqbn())) } server := debugProperties.Get("server") diff --git a/commands/instances.go b/commands/instances.go index cc8fd1ed92f..b071ac580cc 100644 --- a/commands/instances.go +++ b/commands/instances.go @@ -90,13 +90,13 @@ func (instance *CoreInstance) installToolIfMissing(tool *cores.ToolRelease, down if tool.IsInstalled() { return false, nil } - taskCB(&rpc.TaskProgress{Name: "Downloading missing tool " + tool.String()}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Downloading missing tool %s"), tool)}) if err := DownloadToolRelease(instance.PackageManager, tool, downloadCB); err != nil { - return false, fmt.Errorf("downloading %s tool: %s", tool, err) + return false, fmt.Errorf(tr("downloading %[1]s tool: %[2]s"), tool, err) } taskCB(&rpc.TaskProgress{Completed: true}) if err := InstallToolRelease(instance.PackageManager, tool, taskCB); err != nil { - return false, fmt.Errorf("installing %s tool: %s", tool, err) + return false, fmt.Errorf(tr("installing %[1]s tool: %[2]s"), tool, err) } return true, nil } @@ -172,7 +172,7 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) *sta } instance := instances[req.Instance.Id] if instance == nil { - return status.Newf(codes.InvalidArgument, "Invalid instance ID") + return status.Newf(codes.InvalidArgument, tr("Invalid instance ID")) } // We need to clear the PackageManager currently in use by this instance @@ -190,7 +190,7 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) *sta for _, u := range urls { URL, err := utils.URLParse(u) if err != nil { - s := status.Newf(codes.InvalidArgument, "Invalid additional URL: %v", err) + s := status.Newf(codes.InvalidArgument, tr("Invalid additional URL: %v"), err) responseCallback(&rpc.InitResponse{ Message: &rpc.InitResponse_Error{ Error: s.Proto(), @@ -204,7 +204,7 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) *sta _, err := instance.PackageManager.LoadPackageIndexFromFile(indexFile) if err != nil { - s := status.Newf(codes.FailedPrecondition, "Loading index file: %v", err) + s := status.Newf(codes.FailedPrecondition, tr("Loading index file: %v"), err) responseCallback(&rpc.InitResponse{ Message: &rpc.InitResponse_Error{ Error: s.Proto(), @@ -215,7 +215,7 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) *sta } if err := instance.PackageManager.LoadPackageIndex(URL); err != nil { - s := status.Newf(codes.FailedPrecondition, "Loading index file: %v", err) + s := status.Newf(codes.FailedPrecondition, tr("Loading index file: %v"), err) responseCallback(&rpc.InitResponse{ Message: &rpc.InitResponse_Error{ Error: s.Proto(), @@ -298,7 +298,7 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) *sta } if err := instance.lm.LoadIndex(); err != nil { - s := status.Newf(codes.FailedPrecondition, "Loading index file: %v", err) + s := status.Newf(codes.FailedPrecondition, tr("Loading index file: %v"), err) responseCallback(&rpc.InitResponse{ Message: &rpc.InitResponse_Error{ Error: s.Proto(), @@ -307,7 +307,7 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) *sta } for _, err := range instance.lm.RescanLibraries() { - s := status.Newf(codes.FailedPrecondition, "Loading libraries: %v", err) + s := status.Newf(codes.FailedPrecondition, tr("Loading libraries: %v"), err) responseCallback(&rpc.InitResponse{ Message: &rpc.InitResponse_Error{ Error: s.Proto(), @@ -322,7 +322,7 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) *sta func Destroy(ctx context.Context, req *rpc.DestroyRequest) (*rpc.DestroyResponse, error) { id := req.GetInstance().GetId() if _, ok := instances[id]; !ok { - return nil, fmt.Errorf("invalid handle") + return nil, fmt.Errorf(tr("invalid handle")) } delete(instances, id) @@ -334,7 +334,7 @@ func UpdateLibrariesIndex(ctx context.Context, req *rpc.UpdateLibrariesIndexRequ logrus.Info("Updating libraries index") lm := GetLibraryManager(req.GetInstance().GetId()) if lm == nil { - return fmt.Errorf("invalid handle") + return fmt.Errorf(tr("invalid handle")) } config, err := GetDownloaderConfig() if err != nil { @@ -355,8 +355,8 @@ func UpdateLibrariesIndex(ctx context.Context, req *rpc.UpdateLibrariesIndexRequ // Download gzipped library_index tmpIndexGz := tmp.Join("library_index.json.gz") if d, err := downloader.DownloadWithConfig(tmpIndexGz.String(), librariesmanager.LibraryIndexGZURL.String(), *config, downloader.NoResume); err == nil { - if err := Download(d, "Updating index: library_index.json.gz", downloadCB); err != nil { - return errors.Wrap(err, "downloading library_index.json.gz") + if err := Download(d, tr("Updating index: library_index.json.gz"), downloadCB); err != nil { + return errors.Wrap(err, tr("downloading library_index.json.gz")) } } else { return err @@ -365,8 +365,8 @@ func UpdateLibrariesIndex(ctx context.Context, req *rpc.UpdateLibrariesIndexRequ // Download signature tmpSignature := tmp.Join("library_index.json.sig") if d, err := downloader.DownloadWithConfig(tmpSignature.String(), librariesmanager.LibraryIndexSignature.String(), *config, downloader.NoResume); err == nil { - if err := Download(d, "Updating index: library_index.json.sig", downloadCB); err != nil { - return errors.Wrap(err, "downloading library_index.json.sig") + if err := Download(d, tr("Updating index: library_index.json.sig"), downloadCB); err != nil { + return errors.Wrap(err, tr("downloading library_index.json.sig")) } } else { return err @@ -375,24 +375,24 @@ func UpdateLibrariesIndex(ctx context.Context, req *rpc.UpdateLibrariesIndexRequ // Extract the real library_index tmpIndex := tmp.Join("library_index.json") if err := paths.GUnzip(tmpIndexGz, tmpIndex); err != nil { - return errors.Wrap(err, "unzipping library_index.json.gz") + return errors.Wrap(err, tr("unzipping library_index.json.gz")) } // Check signature if ok, _, err := security.VerifyArduinoDetachedSignature(tmpIndex, tmpSignature); err != nil { - return errors.Wrap(err, "verifying signature") + return errors.Wrap(err, tr("verifying signature")) } else if !ok { - return errors.New("library_index.json has an invalid signature") + return errors.New(tr("library_index.json has an invalid signature")) } // Copy extracted library_index and signature to final destination lm.IndexFile.Remove() lm.IndexFileSignature.Remove() if err := tmpIndex.CopyTo(lm.IndexFile); err != nil { - return errors.Wrap(err, "writing library_index.json") + return errors.Wrap(err, tr("writing library_index.json")) } if err := tmpSignature.CopyTo(lm.IndexFileSignature); err != nil { - return errors.Wrap(err, "writing library_index.json.sig") + return errors.Wrap(err, tr("writing library_index.json.sig")) } return nil @@ -403,7 +403,7 @@ func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB Do id := req.GetInstance().GetId() _, ok := instances[id] if !ok { - return nil, fmt.Errorf("invalid handle") + return nil, fmt.Errorf(tr("invalid handle")) } indexpath := paths.New(configuration.Settings.GetString("directories.Data")) @@ -423,12 +423,12 @@ func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB Do if URL.Scheme == "file" { path := paths.New(URL.Path) if _, err := packageindex.LoadIndexNoSign(path); err != nil { - return nil, fmt.Errorf("invalid package index in %s: %s", path, err) + return nil, fmt.Errorf(tr("invalid package index in %[1]s: %[2]s"), path, err) } fi, _ := os.Stat(path.String()) downloadCB(&rpc.DownloadProgress{ - File: "Updating index: " + path.Base(), + File: fmt.Sprintf(tr("Updating index: %s"), path.Base()), TotalSize: fi.Size(), }) downloadCB(&rpc.DownloadProgress{Completed: true}) @@ -437,9 +437,9 @@ func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB Do var tmp *paths.Path if tmpFile, err := ioutil.TempFile("", ""); err != nil { - return nil, fmt.Errorf("creating temp file for index download: %s", err) + return nil, fmt.Errorf(tr("creating temp file for index download: %s"), err) } else if err := tmpFile.Close(); err != nil { - return nil, fmt.Errorf("creating temp file for index download: %s", err) + return nil, fmt.Errorf(tr("creating temp file for index download: %s"), err) } else { tmp = paths.New(tmpFile.Name()) } @@ -447,16 +447,16 @@ func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB Do config, err := GetDownloaderConfig() if err != nil { - return nil, fmt.Errorf("downloading index %s: %s", URL, err) + return nil, fmt.Errorf(tr("downloading index %[1]s: %[2]s"), URL, err) } d, err := downloader.DownloadWithConfig(tmp.String(), URL.String(), *config) if err != nil { - return nil, fmt.Errorf("downloading index %s: %s", URL, err) + return nil, fmt.Errorf(tr("downloading index %[1]s: %[2]s"), URL, err) } coreIndexPath := indexpath.Join(path.Base(URL.Path)) - err = Download(d, "Updating index: "+coreIndexPath.Base(), downloadCB) + err = Download(d, fmt.Sprintf(tr("Updating index: %s"), coreIndexPath.Base()), downloadCB) if err != nil { - return nil, fmt.Errorf("downloading index %s: %s", URL, err) + return nil, fmt.Errorf(tr("downloading index %[1]s: %[2]s"), URL, err) } // Check for signature @@ -465,14 +465,14 @@ func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB Do if URL.Hostname() == "downloads.arduino.cc" { URLSig, err := url.Parse(URL.String()) if err != nil { - return nil, fmt.Errorf("parsing url for index signature check: %s", err) + return nil, fmt.Errorf(tr("parsing url for index signature check: %s"), err) } URLSig.Path += ".sig" if t, err := ioutil.TempFile("", ""); err != nil { - return nil, fmt.Errorf("creating temp file for index signature download: %s", err) + return nil, fmt.Errorf(tr("creating temp file for index signature download: %s"), err) } else if err := t.Close(); err != nil { - return nil, fmt.Errorf("creating temp file for index signature download: %s", err) + return nil, fmt.Errorf(tr("creating temp file for index signature download: %s"), err) } else { tmpSig = paths.New(t.Name()) } @@ -484,34 +484,34 @@ func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB Do } coreIndexSigPath = indexpath.Join(path.Base(URLSig.Path)) - Download(d, "Updating index: "+coreIndexSigPath.Base(), downloadCB) + Download(d, fmt.Sprintf(tr("Updating index: %s"), coreIndexSigPath.Base()), downloadCB) if d.Error() != nil { - return nil, fmt.Errorf("downloading index signature %s: %s", URL, d.Error()) + return nil, fmt.Errorf(tr("downloading index signature %[1]s: %[2]s"), URL, d.Error()) } valid, _, err := security.VerifyArduinoDetachedSignature(tmp, tmpSig) if err != nil { - return nil, fmt.Errorf("signature verification error: %s", err) + return nil, fmt.Errorf(tr("signature verification error: %s"), err) } if !valid { - return nil, fmt.Errorf("index has an invalid signature") + return nil, fmt.Errorf(tr("index has an invalid signature")) } } if _, err := packageindex.LoadIndex(tmp); err != nil { - return nil, fmt.Errorf("invalid package index in %s: %s", URL, err) + return nil, fmt.Errorf(tr("invalid package index in %[1]s: %[2]s"), URL, err) } if err := indexpath.MkdirAll(); err != nil { - return nil, fmt.Errorf("can't create data directory %s: %s", indexpath, err) + return nil, fmt.Errorf(tr("can't create data directory %[1]s: %[2]s"), indexpath, err) } if err := tmp.CopyTo(coreIndexPath); err != nil { - return nil, fmt.Errorf("saving downloaded index %s: %s", URL, err) + return nil, fmt.Errorf(tr("saving downloaded index %[1]s: %[2]s"), URL, err) } if tmpSig != nil { if err := tmpSig.CopyTo(coreIndexSigPath); err != nil { - return nil, fmt.Errorf("saving downloaded index signature: %s", err) + return nil, fmt.Errorf(tr("saving downloaded index signature: %s"), err) } } } @@ -544,7 +544,7 @@ func Outdated(ctx context.Context, req *rpc.OutdatedRequest) (*rpc.OutdatedRespo libraryManager := GetLibraryManager(id) if libraryManager == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } outdatedLibraries := []*rpc.InstalledLibrary{} @@ -567,7 +567,7 @@ func Outdated(ctx context.Context, req *rpc.OutdatedRequest) (*rpc.OutdatedRespo packageManager := GetPackageManager(id) if packageManager == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } outdatedPlatforms := []*rpc.Platform{} @@ -665,7 +665,7 @@ func Upgrade(ctx context.Context, req *rpc.UpgradeRequest, downloadCB DownloadPr lm := GetLibraryManager(req.Instance.Id) if lm == nil { - return fmt.Errorf("invalid handle") + return fmt.Errorf(tr("invalid handle")) } for _, libAlternatives := range lm.Libraries { @@ -679,7 +679,7 @@ func Upgrade(ctx context.Context, req *rpc.UpgradeRequest, downloadCB DownloadPr } // Downloads latest library release - taskCB(&rpc.TaskProgress{Name: "Downloading " + available.String()}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Downloading %s"), available)}) if d, err := available.Resource.Download(lm.DownloadsDir, downloaderConfig); err != nil { return err } else if err := Download(d, available.String(), downloadCB); err != nil { @@ -687,30 +687,30 @@ func Upgrade(ctx context.Context, req *rpc.UpgradeRequest, downloadCB DownloadPr } // Installs downloaded library - taskCB(&rpc.TaskProgress{Name: "Installing " + available.String()}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Installing %s"), available)}) libPath, libReplaced, err := lm.InstallPrerequisiteCheck(available) if err == librariesmanager.ErrAlreadyInstalled { - taskCB(&rpc.TaskProgress{Message: "Already installed " + available.String(), Completed: true}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Already installed %s"), available), Completed: true}) continue } else if err != nil { - return fmt.Errorf("checking lib install prerequisites: %s", err) + return fmt.Errorf(tr("checking lib install prerequisites: %s"), err) } if libReplaced != nil { - taskCB(&rpc.TaskProgress{Message: fmt.Sprintf("Replacing %s with %s", libReplaced, available)}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Replacing %[1]s with %[2]s"), libReplaced, available)}) } if err := lm.Install(available, libPath); err != nil { return err } - taskCB(&rpc.TaskProgress{Message: "Installed " + available.String(), Completed: true}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Installed %s"), available), Completed: true}) } } pm := GetPackageManager(req.Instance.Id) if pm == nil { - return fmt.Errorf("invalid handle") + return fmt.Errorf(tr("invalid handle")) } for _, targetPackage := range pm.Packages { @@ -738,17 +738,17 @@ func Upgrade(ctx context.Context, req *rpc.UpgradeRequest, downloadCB DownloadPr PlatformVersion: latest.Version, } - taskCB(&rpc.TaskProgress{Name: "Downloading " + latest.String()}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Downloading %s"), latest)}) _, tools, err := pm.FindPlatformReleaseDependencies(ref) if err != nil { - return fmt.Errorf("platform %s is not installed", ref) + return fmt.Errorf(tr("platform %s is not installed"), ref) } toolsToInstall := []*cores.ToolRelease{} for _, tool := range tools { if tool.IsInstalled() { logrus.WithField("tool", tool).Warn("Tool already installed") - taskCB(&rpc.TaskProgress{Name: "Tool " + tool.String() + " already installed", Completed: true}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Tool %s already installed"), tool), Completed: true}) } else { toolsToInstall = append(toolsToInstall, tool) } @@ -757,7 +757,7 @@ func Upgrade(ctx context.Context, req *rpc.UpgradeRequest, downloadCB DownloadPr // Downloads platform tools for _, tool := range toolsToInstall { if err := DownloadToolRelease(pm, tool, downloadCB); err != nil { - taskCB(&rpc.TaskProgress{Message: "Error downloading tool " + tool.String()}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Error downloading tool %s"), tool)}) return err } } @@ -770,12 +770,12 @@ func Upgrade(ctx context.Context, req *rpc.UpgradeRequest, downloadCB DownloadPr } logrus.Info("Updating platform " + installed.String()) - taskCB(&rpc.TaskProgress{Name: "Updating " + latest.String()}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Updating %s"), latest)}) // Installs tools for _, tool := range toolsToInstall { if err := InstallToolRelease(pm, tool, taskCB); err != nil { - taskCB(&rpc.TaskProgress{Message: "Error installing tool " + tool.String()}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Error installing tool %s"), tool)}) return err } } @@ -784,7 +784,7 @@ func Upgrade(ctx context.Context, req *rpc.UpgradeRequest, downloadCB DownloadPr err = pm.InstallPlatform(latest) if err != nil { logrus.WithError(err).Error("Cannot install platform") - taskCB(&rpc.TaskProgress{Message: "Error installing " + latest.String()}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Error installing %s"), latest)}) return err } @@ -794,12 +794,12 @@ func Upgrade(ctx context.Context, req *rpc.UpgradeRequest, downloadCB DownloadPr // In case uninstall fails tries to rollback if err != nil { logrus.WithError(err).Error("Error updating platform.") - taskCB(&rpc.TaskProgress{Message: "Error upgrading platform: " + err.Error()}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Error upgrading platform: %s"), err)}) // Rollback if err := pm.UninstallPlatform(latest); err != nil { logrus.WithError(err).Error("Error rolling-back changes.") - taskCB(&rpc.TaskProgress{Message: "Error rolling-back changes: " + err.Error()}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Error rolling-back changes: %s"), err)}) return err } } @@ -810,7 +810,7 @@ func Upgrade(ctx context.Context, req *rpc.UpgradeRequest, downloadCB DownloadPr log := pm.Log.WithField("Tool", toolRelease) log.Info("Uninstalling tool") - taskCB(&rpc.TaskProgress{Name: "Uninstalling " + toolRelease.String() + ", tool is no more required"}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Uninstalling %s, tool is no more required"), toolRelease)}) if err := pm.UninstallTool(toolRelease); err != nil { log.WithError(err).Error("Error uninstalling") @@ -818,20 +818,20 @@ func Upgrade(ctx context.Context, req *rpc.UpgradeRequest, downloadCB DownloadPr } log.Info("Tool uninstalled") - taskCB(&rpc.TaskProgress{Message: toolRelease.String() + " uninstalled", Completed: true}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("%s uninstalled"), toolRelease), Completed: true}) } } // Perform post install if !req.SkipPostInstall { logrus.Info("Running post_install script") - taskCB(&rpc.TaskProgress{Message: "Configuring platform"}) + taskCB(&rpc.TaskProgress{Message: tr("Configuring platform")}) if err := pm.RunPostInstallScript(latest); err != nil { - taskCB(&rpc.TaskProgress{Message: fmt.Sprintf("WARNING: cannot run post install: %s", err)}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("WARNING: cannot run post install: %s"), err)}) } } else { logrus.Info("Skipping platform configuration (post_install run).") - taskCB(&rpc.TaskProgress{Message: "Skipping platform configuration"}) + taskCB(&rpc.TaskProgress{Message: tr("Skipping platform configuration")}) } } } @@ -845,7 +845,7 @@ func LoadSketch(ctx context.Context, req *rpc.LoadSketchRequest) (*rpc.LoadSketc // TODO: This should be a ToRpc function for the Sketch struct sketch, err := sk.New(paths.New(req.SketchPath)) if err != nil { - return nil, fmt.Errorf("error loading sketch %v: %v", req.SketchPath, err) + return nil, fmt.Errorf(tr("error loading sketch %[1]v: %[2]v"), req.SketchPath, err) } otherSketchFiles := make([]string, sketch.OtherSketchFiles.Len()) diff --git a/commands/lib/download.go b/commands/lib/download.go index 3b1ae102c38..8bd61e7a246 100644 --- a/commands/lib/download.go +++ b/commands/lib/download.go @@ -22,10 +22,13 @@ import ( "github.com/arduino/arduino-cli/arduino/libraries/librariesindex" "github.com/arduino/arduino-cli/arduino/libraries/librariesmanager" "github.com/arduino/arduino-cli/commands" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/sirupsen/logrus" ) +var tr = i18n.Tr + // LibraryDownload FIXMEDOC func LibraryDownload(ctx context.Context, req *rpc.LibraryDownloadRequest, downloadCB commands.DownloadProgressCB) (*rpc.LibraryDownloadResponse, error) { logrus.Info("Executing `arduino lib download`") @@ -36,7 +39,7 @@ func LibraryDownload(ctx context.Context, req *rpc.LibraryDownloadRequest, downl lib, err := findLibraryIndexRelease(lm, req) if err != nil { - return nil, fmt.Errorf("looking for library: %s", err) + return nil, fmt.Errorf(tr("looking for library: %s"), err) } if err := downloadLibrary(lm, lib, downloadCB, func(*rpc.TaskProgress) {}); err != nil { @@ -49,7 +52,7 @@ func LibraryDownload(ctx context.Context, req *rpc.LibraryDownloadRequest, downl func downloadLibrary(lm *librariesmanager.LibrariesManager, libRelease *librariesindex.Release, downloadCB commands.DownloadProgressCB, taskCB commands.TaskProgressCB) error { - taskCB(&rpc.TaskProgress{Name: "Downloading " + libRelease.String()}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Downloading %s"), libRelease)}) config, err := commands.GetDownloaderConfig() if err != nil { return err diff --git a/commands/lib/install.go b/commands/lib/install.go index b000146cf11..c0bfb0e2f98 100644 --- a/commands/lib/install.go +++ b/commands/lib/install.go @@ -45,13 +45,13 @@ func LibraryInstall(ctx context.Context, req *rpc.LibraryInstallRequest, Version: req.Version, }) if err != nil { - return fmt.Errorf("Error resolving dependencies for %s@%s: %s", req.Name, req.Version, err) + return fmt.Errorf(tr("Error resolving dependencies for %[1]s@%[2]s: %[3]s"), req.Name, req.Version, err) } for _, dep := range res.Dependencies { if existingDep, has := toInstall[dep.Name]; has { if existingDep.VersionRequired != dep.VersionRequired { - return fmt.Errorf("two different versions of the library %s are required: %s and %s", + return fmt.Errorf(tr("two different versions of the library %[1]s are required: %[2]s and %[3]s"), dep.Name, dep.VersionRequired, existingDep.VersionRequired) } } @@ -65,11 +65,11 @@ func LibraryInstall(ctx context.Context, req *rpc.LibraryInstallRequest, Version: lib.VersionRequired, }) if err != nil { - return fmt.Errorf("looking for library: %s", err) + return fmt.Errorf(tr("looking for library: %s"), err) } if err := downloadLibrary(lm, libRelease, downloadCB, taskCB); err != nil { - return fmt.Errorf("downloading library: %s", err) + return fmt.Errorf(tr("downloading library: %s"), err) } if err := installLibrary(lm, libRelease, taskCB); err != nil { @@ -79,33 +79,33 @@ func LibraryInstall(ctx context.Context, req *rpc.LibraryInstallRequest, status := commands.Init(&rpc.InitRequest{Instance: req.Instance}, nil) if status != nil { - return fmt.Errorf("rescanning libraries: %s", status.Err()) + return fmt.Errorf(tr("rescanning libraries: %s"), status.Err()) } return nil } func installLibrary(lm *librariesmanager.LibrariesManager, libRelease *librariesindex.Release, taskCB commands.TaskProgressCB) error { - taskCB(&rpc.TaskProgress{Name: "Installing " + libRelease.String()}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Installing %s"), libRelease)}) logrus.WithField("library", libRelease).Info("Installing library") libPath, libReplaced, err := lm.InstallPrerequisiteCheck(libRelease) if err == librariesmanager.ErrAlreadyInstalled { - taskCB(&rpc.TaskProgress{Message: "Already installed " + libRelease.String(), Completed: true}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Already installed %s"), libRelease), Completed: true}) return nil } if err != nil { - return fmt.Errorf("checking lib install prerequisites: %s", err) + return fmt.Errorf(tr("checking lib install prerequisites: %s"), err) } if libReplaced != nil { - taskCB(&rpc.TaskProgress{Message: fmt.Sprintf("Replacing %s with %s", libReplaced, libRelease)}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Replacing %[1]s with %[2]s"), libReplaced, libRelease)}) } if err := lm.Install(libRelease, libPath); err != nil { return err } - taskCB(&rpc.TaskProgress{Message: "Installed " + libRelease.String(), Completed: true}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Installed %s"), libRelease), Completed: true}) return nil } @@ -115,7 +115,7 @@ func ZipLibraryInstall(ctx context.Context, req *rpc.ZipLibraryInstallRequest, t if err := lm.InstallZipLib(ctx, req.Path, req.Overwrite); err != nil { return err } - taskCB(&rpc.TaskProgress{Message: "Installed Archived Library", Completed: true}) + taskCB(&rpc.TaskProgress{Message: tr("Installed Archived Library"), Completed: true}) return nil } @@ -125,6 +125,6 @@ func GitLibraryInstall(ctx context.Context, req *rpc.GitLibraryInstallRequest, t if err := lm.InstallGitLib(req.Url, req.Overwrite); err != nil { return err } - taskCB(&rpc.TaskProgress{Message: "Installed Library from Git URL", Completed: true}) + taskCB(&rpc.TaskProgress{Message: tr("Installed Library from Git URL"), Completed: true}) return nil } diff --git a/commands/lib/list.go b/commands/lib/list.go index 204af4fc847..3642dff930f 100644 --- a/commands/lib/list.go +++ b/commands/lib/list.go @@ -38,12 +38,12 @@ type installedLib struct { func LibraryList(ctx context.Context, req *rpc.LibraryListRequest) (*rpc.LibraryListResponse, error) { pm := commands.GetPackageManager(req.GetInstance().GetId()) if pm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } lm := commands.GetLibraryManager(req.GetInstance().GetId()) if lm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } nameFilter := strings.ToLower(req.GetName()) @@ -53,11 +53,11 @@ func LibraryList(ctx context.Context, req *rpc.LibraryListRequest) (*rpc.Library if f := req.GetFqbn(); f != "" { fqbn, err := cores.ParseFQBN(req.GetFqbn()) if err != nil { - return nil, fmt.Errorf("parsing fqbn: %s", err) + return nil, fmt.Errorf(tr("parsing fqbn: %s"), err) } _, boardPlatform, _, _, refBoardPlatform, err := pm.ResolveFQBN(fqbn) if err != nil { - return nil, fmt.Errorf("loading board data: %s", err) + return nil, fmt.Errorf(tr("loading board data: %s"), err) } filteredRes := map[string]*installedLib{} @@ -105,7 +105,7 @@ func LibraryList(ctx context.Context, req *rpc.LibraryListRequest) (*rpc.Library } rpcLib, err := lib.Library.ToRPCLibrary() if err != nil { - return nil, fmt.Errorf("converting library %s to rpc struct: %w", lib.Library.Name, err) + return nil, fmt.Errorf(tr("converting library %[1]s to rpc struct: %[2]w"), lib.Library.Name, err) } instaledLibs = append(instaledLibs, &rpc.InstalledLibrary{ Library: rpcLib, diff --git a/commands/lib/resolve_deps.go b/commands/lib/resolve_deps.go index 6795a22a2bc..1ef7737a32c 100644 --- a/commands/lib/resolve_deps.go +++ b/commands/lib/resolve_deps.go @@ -31,7 +31,7 @@ func LibraryResolveDependencies(ctx context.Context, req *rpc.LibraryResolveDepe // Search the requested lib reqLibRelease, err := findLibraryIndexRelease(lm, req) if err != nil { - return nil, fmt.Errorf("looking for library: %s", err) + return nil, fmt.Errorf(tr("looking for library: %s"), err) } // Extract all installed libraries @@ -48,12 +48,12 @@ func LibraryResolveDependencies(ctx context.Context, req *rpc.LibraryResolveDepe // Check if there is a problem with the first level deps for _, directDep := range reqLibRelease.GetDependencies() { if _, ok := lm.Index.Libraries[directDep.GetName()]; !ok { - return nil, fmt.Errorf("dependency '%s' is not available", directDep.GetName()) + return nil, fmt.Errorf(tr("dependency '%s' is not available"), directDep.GetName()) } } // Otherwise there is no possible solution, the depends field has an invalid formula - return nil, fmt.Errorf("no valid solution found") + return nil, fmt.Errorf(tr("no valid solution found")) } res := []*rpc.LibraryDependencyStatus{} diff --git a/commands/lib/search.go b/commands/lib/search.go index 82bada6b7cd..135b13bc4a7 100644 --- a/commands/lib/search.go +++ b/commands/lib/search.go @@ -32,7 +32,7 @@ import ( func LibrarySearch(ctx context.Context, req *rpc.LibrarySearchRequest) (*rpc.LibrarySearchResponse, error) { lm := commands.GetLibraryManager(req.GetInstance().GetId()) if lm == nil { - return nil, errors.New("invalid instance") + return nil, errors.New(tr("invalid instance")) } return searchLibrary(req, lm) diff --git a/commands/lib/uninstall.go b/commands/lib/uninstall.go index 5395109a9e8..205d73e2346 100644 --- a/commands/lib/uninstall.go +++ b/commands/lib/uninstall.go @@ -34,9 +34,9 @@ func LibraryUninstall(ctx context.Context, req *rpc.LibraryUninstallRequest, tas lib := lm.FindByReference(ref) if lib == nil { - taskCB(&rpc.TaskProgress{Message: fmt.Sprintf("Library %s is not installed", req.Name), Completed: true}) + taskCB(&rpc.TaskProgress{Message: fmt.Sprintf(tr("Library %s is not installed"), req.Name), Completed: true}) } else { - taskCB(&rpc.TaskProgress{Name: "Uninstalling " + lib.String()}) + taskCB(&rpc.TaskProgress{Name: fmt.Sprintf(tr("Uninstalling %s"), lib)}) lm.Uninstall(lib) taskCB(&rpc.TaskProgress{Completed: true}) } diff --git a/commands/lib/upgrade.go b/commands/lib/upgrade.go index 5c71a923f8c..9b97bb0d269 100644 --- a/commands/lib/upgrade.go +++ b/commands/lib/upgrade.go @@ -35,7 +35,7 @@ func LibraryUpgradeAll(instanceID int32, downloadCB commands.DownloadProgressCB, status := commands.Init(&rpc.InitRequest{Instance: &rpc.Instance{Id: instanceID}}, nil) if status != nil { - return fmt.Errorf("rescanning libraries: %s", status.Err()) + return fmt.Errorf(tr("rescanning libraries: %s"), status.Err()) } return nil diff --git a/commands/lib/utils.go b/commands/lib/utils.go index 94bf4f1772d..0ed26a4031e 100644 --- a/commands/lib/utils.go +++ b/commands/lib/utils.go @@ -31,7 +31,7 @@ type libraryReferencer interface { func createLibIndexReference(lm *librariesmanager.LibrariesManager, req libraryReferencer) (*librariesindex.Reference, error) { version, err := commands.ParseVersion(req) if err != nil { - return nil, fmt.Errorf("invalid version: %s", err) + return nil, fmt.Errorf(tr("invalid version: %s"), err) } return &librariesindex.Reference{Name: req.GetName(), Version: version}, nil @@ -44,7 +44,7 @@ func findLibraryIndexRelease(lm *librariesmanager.LibrariesManager, req libraryR } lib := lm.Index.FindRelease(ref) if lib == nil { - return nil, fmt.Errorf("library %s not found", ref) + return nil, fmt.Errorf(tr("library %s not found"), ref) } return lib, nil } diff --git a/commands/sketch/archive.go b/commands/sketch/archive.go index 79e58973068..a45e5b89aaa 100644 --- a/commands/sketch/archive.go +++ b/commands/sketch/archive.go @@ -24,10 +24,13 @@ import ( "strings" "github.com/arduino/arduino-cli/arduino/sketch" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" paths "github.com/arduino/go-paths-helper" ) +var tr = i18n.Tr + // ArchiveSketch FIXMEDOC func ArchiveSketch(ctx context.Context, req *rpc.ArchiveSketchRequest) (*rpc.ArchiveSketchResponse, error) { // sketchName is the name of the sketch without extension, for example "MySketch" @@ -53,7 +56,7 @@ func ArchiveSketch(ctx context.Context, req *rpc.ArchiveSketchRequest) (*rpc.Arc archivePath, err = archivePath.Clean().Abs() if err != nil { - return nil, fmt.Errorf("Error getting absolute archive path %v", err) + return nil, fmt.Errorf(tr("Error getting absolute archive path %v"), err) } // Makes archivePath point to a zip file @@ -64,18 +67,18 @@ func ArchiveSketch(ctx context.Context, req *rpc.ArchiveSketchRequest) (*rpc.Arc } if archivePath.Exist() { - return nil, fmt.Errorf("archive already exists") + return nil, fmt.Errorf(tr("archive already exists")) } filesToZip, err := sketchPath.ReadDirRecursive() if err != nil { - return nil, fmt.Errorf("Error retrieving sketch files: %v", err) + return nil, fmt.Errorf(tr("Error retrieving sketch files: %v"), err) } filesToZip.FilterOutDirs() archive, err := archivePath.Create() if err != nil { - return nil, fmt.Errorf("Error creating archive: %v", err) + return nil, fmt.Errorf(tr("Error creating archive: %v"), err) } defer archive.Close() @@ -87,7 +90,7 @@ func ArchiveSketch(ctx context.Context, req *rpc.ArchiveSketchRequest) (*rpc.Arc if !req.IncludeBuildDir { filePath, err := sketchPath.Parent().RelTo(f) if err != nil { - return nil, fmt.Errorf("Error calculating relative file path: %v", err) + return nil, fmt.Errorf(tr("Error calculating relative file path: %v"), err) } // Skips build folder @@ -100,7 +103,7 @@ func ArchiveSketch(ctx context.Context, req *rpc.ArchiveSketchRequest) (*rpc.Arc // If we don't do this the archive would contain all the sketch files as top level. err = addFileToSketchArchive(zipWriter, f, sketchPath.Parent()) if err != nil { - return nil, fmt.Errorf("Error adding file to archive: %v", err) + return nil, fmt.Errorf(tr("Error adding file to archive: %v"), err) } } diff --git a/commands/upload/programmers_list.go b/commands/upload/programmers_list.go index 189847cf67f..a6c478edcff 100644 --- a/commands/upload/programmers_list.go +++ b/commands/upload/programmers_list.go @@ -30,17 +30,17 @@ func ListProgrammersAvailableForUpload(ctx context.Context, req *rpc.ListProgram fqbnIn := req.GetFqbn() if fqbnIn == "" { - return nil, fmt.Errorf("no Fully Qualified Board Name provided") + return nil, fmt.Errorf(tr("no Fully Qualified Board Name provided")) } fqbn, err := cores.ParseFQBN(fqbnIn) if err != nil { - return nil, fmt.Errorf("incorrect FQBN: %s", err) + return nil, fmt.Errorf(tr("incorrect FQBN: %s"), err) } // Find target platforms _, platform, _, _, refPlatform, err := pm.ResolveFQBN(fqbn) if err != nil { - return nil, fmt.Errorf("incorrect FQBN: %s", err) + return nil, fmt.Errorf(tr("incorrect FQBN: %s"), err) } result := []*rpc.Programmer{} diff --git a/commands/upload/upload.go b/commands/upload/upload.go index 859c9489860..e329506f129 100644 --- a/commands/upload/upload.go +++ b/commands/upload/upload.go @@ -30,6 +30,7 @@ import ( "github.com/arduino/arduino-cli/arduino/sketch" "github.com/arduino/arduino-cli/commands" "github.com/arduino/arduino-cli/executils" + "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" paths "github.com/arduino/go-paths-helper" properties "github.com/arduino/go-properties-orderedmap" @@ -37,6 +38,8 @@ import ( "github.com/sirupsen/logrus" ) +var tr = i18n.Tr + // Upload FIXMEDOC func Upload(ctx context.Context, req *rpc.UploadRequest, outStream io.Writer, errStream io.Writer) (*rpc.UploadResponse, error) { logrus.Tracef("Upload %s on %s started", req.GetSketchPath(), req.GetFqbn()) @@ -46,7 +49,7 @@ func Upload(ctx context.Context, req *rpc.UploadRequest, outStream io.Writer, er sketchPath := paths.New(req.GetSketchPath()) sk, err := sketch.New(sketchPath) if err != nil && req.GetImportDir() == "" && req.GetImportFile() == "" { - return nil, fmt.Errorf("opening sketch: %s", err) + return nil, fmt.Errorf(tr("opening sketch: %s"), err) } pm := commands.GetPackageManager(req.GetInstance().GetId()) @@ -77,7 +80,7 @@ func UsingProgrammer(ctx context.Context, req *rpc.UploadUsingProgrammerRequest, logrus.Tracef("Upload using programmer %s on %s started", req.GetSketchPath(), req.GetFqbn()) if req.GetProgrammer() == "" { - return nil, errors.New("programmer not specified") + return nil, errors.New(tr("programmer not specified")) } _, err := Upload(ctx, &rpc.UploadRequest{ Instance: req.GetInstance(), @@ -102,14 +105,14 @@ func runProgramAction(pm *packagemanager.PackageManager, dryRun bool) error { if burnBootloader && programmerID == "" { - return fmt.Errorf("no programmer specified for burning bootloader") + return fmt.Errorf(tr("no programmer specified for burning bootloader")) } // FIXME: make a specification on how a port is specified via command line if port == "" && sk != nil && sk.Metadata != nil { deviceURI, err := url.Parse(sk.Metadata.CPU.Port) if err != nil { - return fmt.Errorf("invalid Device URL format: %s", err) + return fmt.Errorf(tr("invalid Device URL format: %s"), err) } if deviceURI.Scheme == "serial" { port = deviceURI.Host + deviceURI.Path @@ -121,18 +124,18 @@ func runProgramAction(pm *packagemanager.PackageManager, fqbnIn = sk.Metadata.CPU.Fqbn } if fqbnIn == "" { - return fmt.Errorf("no Fully Qualified Board Name provided") + return fmt.Errorf(tr("no Fully Qualified Board Name provided")) } fqbn, err := cores.ParseFQBN(fqbnIn) if err != nil { - return fmt.Errorf("incorrect FQBN: %s", err) + return fmt.Errorf(tr("incorrect FQBN: %s"), err) } logrus.WithField("fqbn", fqbn).Tracef("Detected FQBN") // Find target board and board properties _, boardPlatform, board, boardProperties, buildPlatform, err := pm.ResolveFQBN(fqbn) if err != nil { - return fmt.Errorf("incorrect FQBN: %s", err) + return fmt.Errorf(tr("incorrect FQBN: %s"), err) } logrus. WithField("boardPlatform", boardPlatform). @@ -149,7 +152,7 @@ func runProgramAction(pm *packagemanager.PackageManager, programmer = buildPlatform.Programmers[programmerID] } if programmer == nil { - return fmt.Errorf("programmer '%s' not available", programmerID) + return fmt.Errorf(tr("programmer '%s' not available"), programmerID) } } @@ -174,7 +177,7 @@ func runProgramAction(pm *packagemanager.PackageManager, if t, ok := props.GetOk(toolProperty); ok { uploadToolID = t } else { - return fmt.Errorf("cannot get programmer tool: undefined '%s' property", toolProperty) + return fmt.Errorf(tr("cannot get programmer tool: undefined '%s' property"), toolProperty) } } @@ -190,7 +193,7 @@ func runProgramAction(pm *packagemanager.PackageManager, Trace("Upload tool") if split := strings.Split(uploadToolID, ":"); len(split) > 2 { - return fmt.Errorf("invalid 'upload.tool' property: %s", uploadToolID) + return fmt.Errorf(tr("invalid 'upload.tool' property: %s"), uploadToolID) } else if len(split) == 2 { uploadToolID = split[1] uploadToolPlatform = pm.GetInstalledPlatformRelease( @@ -223,13 +226,13 @@ func runProgramAction(pm *packagemanager.PackageManager, if requiredTool.IsInstalled() { uploadProperties.Merge(requiredTool.RuntimeProperties()) } else { - errStream.Write([]byte(fmt.Sprintf("Warning: tool '%s' is not installed. It might not be available for your OS.", requiredTool))) + errStream.Write([]byte(fmt.Sprintf(tr("Warning: tool '%s' is not installed. It might not be available for your OS."), requiredTool))) } } } if !uploadProperties.ContainsKey("upload.protocol") && programmer == nil { - return fmt.Errorf("a programmer is required to upload for this board") + return fmt.Errorf(tr("a programmer is required to upload for this board")) } // Set properties for verbose upload @@ -277,13 +280,13 @@ func runProgramAction(pm *packagemanager.PackageManager, if !burnBootloader { importPath, sketchName, err := determineBuildPathAndSketchName(importFile, importDir, sk, fqbn) if err != nil { - return errors.Errorf("retrieving build artifacts: %s", err) + return errors.Errorf(tr("retrieving build artifacts: %s"), err) } if !importPath.Exist() { - return fmt.Errorf("compiled sketch not found in %s", importPath) + return fmt.Errorf(tr("compiled sketch not found in %s"), importPath) } if !importPath.IsDir() { - return fmt.Errorf("expected compiled sketch in directory %s, but is a file instead", importPath) + return fmt.Errorf(tr("expected compiled sketch in directory %s, but is a file instead"), importPath) } uploadProperties.SetPath("build.path", importPath) uploadProperties.Set("build.project_name", sketchName) @@ -306,21 +309,21 @@ func runProgramAction(pm *packagemanager.PackageManager, // if touch is requested but port is not specified, print a warning if touch && portToTouch == "" { - outStream.Write([]byte(fmt.Sprintln("Skipping 1200-bps touch reset: no serial port selected!"))) + outStream.Write([]byte(fmt.Sprintln(tr("Skipping 1200-bps touch reset: no serial port selected!")))) } cb := &serialutils.ResetProgressCallbacks{ TouchingPort: func(port string) { logrus.WithField("phase", "board reset").Infof("Performing 1200-bps touch reset on serial port %s", port) if verbose { - outStream.Write([]byte(fmt.Sprintf("Performing 1200-bps touch reset on serial port %s", port))) + outStream.Write([]byte(fmt.Sprintf(tr("Performing 1200-bps touch reset on serial port %s"), port))) outStream.Write([]byte(fmt.Sprintln())) } }, WaitingForNewSerial: func() { logrus.WithField("phase", "board reset").Info("Waiting for upload port...") if verbose { - outStream.Write([]byte(fmt.Sprintln("Waiting for upload port..."))) + outStream.Write([]byte(fmt.Sprintln(tr("Waiting for upload port...")))) } }, BootloaderPortFound: func(port string) { @@ -331,10 +334,10 @@ func runProgramAction(pm *packagemanager.PackageManager, } if verbose { if port != "" { - outStream.Write([]byte(fmt.Sprintf("Upload port found on %s", port))) + outStream.Write([]byte(fmt.Sprintf(tr("Upload port found on %s"), port))) outStream.Write([]byte(fmt.Sprintln())) } else { - outStream.Write([]byte(fmt.Sprintf("No upload port found, using %s as fallback", actualPort))) + outStream.Write([]byte(fmt.Sprintf(tr("No upload port found, using %s as fallback"), actualPort))) outStream.Write([]byte(fmt.Sprintln())) } } @@ -345,7 +348,7 @@ func runProgramAction(pm *packagemanager.PackageManager, } if newPort, err := serialutils.Reset(portToTouch, wait, cb, dryRun); err != nil { - outStream.Write([]byte(fmt.Sprintf("Cannot perform port reset: %s", err))) + outStream.Write([]byte(fmt.Sprintf(tr("Cannot perform port reset: %s"), err))) outStream.Write([]byte(fmt.Sprintln())) } else { if newPort != "" { @@ -367,18 +370,18 @@ func runProgramAction(pm *packagemanager.PackageManager, // Run recipes for upload if burnBootloader { if err := runTool("erase.pattern", uploadProperties, outStream, errStream, verbose, dryRun); err != nil { - return fmt.Errorf("chip erase error: %s", err) + return fmt.Errorf(tr("chip erase error: %s"), err) } if err := runTool("bootloader.pattern", uploadProperties, outStream, errStream, verbose, dryRun); err != nil { - return fmt.Errorf("burn bootloader error: %s", err) + return fmt.Errorf(tr("burn bootloader error: %s"), err) } } else if programmer != nil { if err := runTool("program.pattern", uploadProperties, outStream, errStream, verbose, dryRun); err != nil { - return fmt.Errorf("programming error: %s", err) + return fmt.Errorf(tr("programming error: %s"), err) } } else { if err := runTool("upload.pattern", uploadProperties, outStream, errStream, verbose, dryRun); err != nil { - return fmt.Errorf("uploading error: %s", err) + return fmt.Errorf(tr("uploading error: %s"), err) } } @@ -389,18 +392,18 @@ func runProgramAction(pm *packagemanager.PackageManager, func runTool(recipeID string, props *properties.Map, outStream, errStream io.Writer, verbose bool, dryRun bool) error { recipe, ok := props.GetOk(recipeID) if !ok { - return fmt.Errorf("recipe not found '%s'", recipeID) + return fmt.Errorf(tr("recipe not found '%s'"), recipeID) } if strings.TrimSpace(recipe) == "" { return nil // Nothing to run } if props.IsPropertyMissingInExpandPropsInString("serial.port", recipe) { - return fmt.Errorf("no upload port provided") + return fmt.Errorf(tr("no upload port provided")) } cmdLine := props.ExpandPropsInString(recipe) cmdArgs, err := properties.SplitQuotedString(cmdLine, `"'`, false) if err != nil { - return fmt.Errorf("invalid recipe '%s': %s", recipe, err) + return fmt.Errorf(tr("invalid recipe '%[1]s': %[2]s"), recipe, err) } // Run Tool @@ -413,18 +416,18 @@ func runTool(recipeID string, props *properties.Map, outStream, errStream io.Wri } cmd, err := executils.NewProcess(cmdArgs...) if err != nil { - return fmt.Errorf("cannot execute upload tool: %s", err) + return fmt.Errorf(tr("cannot execute upload tool: %s"), err) } cmd.RedirectStdoutTo(outStream) cmd.RedirectStderrTo(errStream) if err := cmd.Start(); err != nil { - return fmt.Errorf("cannot execute upload tool: %s", err) + return fmt.Errorf(tr("cannot execute upload tool: %s"), err) } if err := cmd.Wait(); err != nil { - return fmt.Errorf("uploading error: %s", err) + return fmt.Errorf(tr("uploading error: %s"), err) } return nil @@ -446,7 +449,7 @@ func determineBuildPathAndSketchName(importFile, importDir string, sk *sketch.Sk // Case 1: importFile flag has been specified if importFile != "" { if importDir != "" { - return nil, "", fmt.Errorf("importFile and importDir cannot be used together") + return nil, "", fmt.Errorf(fmt.Sprintf(tr("%s and %s cannot be used together"), "importFile", "importDir")) } // We have a path like "path/to/my/build/SketchName.ino.bin". We are going to @@ -456,7 +459,7 @@ func determineBuildPathAndSketchName(importFile, importDir string, sk *sketch.Sk importFilePath := paths.New(importFile) if !importFilePath.Exist() { - return nil, "", fmt.Errorf("binary file not found in %s", importFilePath) + return nil, "", fmt.Errorf(tr("binary file not found in %s"), importFilePath) } return importFilePath.Parent(), strings.TrimSuffix(importFilePath.Base(), importFilePath.Ext()), nil } @@ -471,14 +474,14 @@ func determineBuildPathAndSketchName(importFile, importDir string, sk *sketch.Sk buildPath := paths.New(importDir) sketchName, err := detectSketchNameFromBuildPath(buildPath) if err != nil { - return nil, "", errors.Errorf("autodetect build artifact: %s", err) + return nil, "", errors.Errorf(tr("autodetect build artifact: %s"), err) } return buildPath, sketchName, nil } // Case 3: nothing given... if sk == nil { - return nil, "", fmt.Errorf("no sketch or build directory/file specified") + return nil, "", fmt.Errorf(tr("no sketch or build directory/file specified")) } // Case 4: only sketch specified. In this case we use the generated build path @@ -523,12 +526,12 @@ func detectSketchNameFromBuildPath(buildPath *paths.Path) (string, error) { } if candidateName != name { - return "", errors.Errorf("multiple build artifacts found: '%s' and '%s'", candidateFile, file) + return "", errors.Errorf(tr("multiple build artifacts found: '%[1]s' and '%[2]s'"), candidateFile, file) } } if candidateName == "" { - return "", errors.New("could not find a valid build artifact") + return "", errors.New(tr("could not find a valid build artifact")) } return candidateName, nil } diff --git a/configuration/configuration.go b/configuration/configuration.go index 01f424c586d..4003c3a68ff 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -22,6 +22,7 @@ import ( "strings" "github.com/arduino/arduino-cli/cli/feedback" + "github.com/arduino/arduino-cli/i18n" paths "github.com/arduino/go-paths-helper" "github.com/arduino/go-win32-utils" "github.com/sirupsen/logrus" @@ -33,6 +34,8 @@ import ( // Settings is a global instance of viper holding configurations for the CLI and the gRPC consumers var Settings *viper.Viper +var tr = i18n.Tr + // Init initialize defaults and read the configuration file. // Please note the logging system hasn't been configured yet, // so logging shouldn't be used here. @@ -63,7 +66,7 @@ func Init(configFile string) *viper.Viper { // ConfigFileNotFoundError is acceptable, anything else // should be reported to the user if _, ok := err.(viper.ConfigFileNotFoundError); !ok { - feedback.Errorf("Error reading config file: %v", err) + feedback.Errorf(tr("Error reading config file: %v"), err) } } @@ -82,7 +85,7 @@ func BindFlags(cmd *cobra.Command, settings *viper.Viper) { func getDefaultArduinoDataDir() string { userHomeDir, err := os.UserHomeDir() if err != nil { - feedback.Errorf("Unable to get user home dir: %v", err) + feedback.Errorf(tr("Unable to get user home dir: %v"), err) return "." } @@ -94,7 +97,7 @@ func getDefaultArduinoDataDir() string { case "windows": localAppDataPath, err := win32.GetLocalAppDataFolder() if err != nil { - feedback.Errorf("Unable to get Local App Data Folder: %v", err) + feedback.Errorf(tr("Unable to get Local App Data Folder: %v"), err) return "." } return filepath.Join(localAppDataPath, "Arduino15") @@ -107,7 +110,7 @@ func getDefaultArduinoDataDir() string { func getDefaultUserDir() string { userHomeDir, err := os.UserHomeDir() if err != nil { - feedback.Errorf("Unable to get user home dir: %v", err) + feedback.Errorf(tr("Unable to get user home dir: %v"), err) return "." } @@ -119,7 +122,7 @@ func getDefaultUserDir() string { case "windows": documentsPath, err := win32.GetDocumentsFolder() if err != nil { - feedback.Errorf("Unable to get Documents Folder: %v", err) + feedback.Errorf(tr("Unable to get Documents Folder: %v"), err) return "." } return filepath.Join(documentsPath, "Arduino") @@ -141,13 +144,13 @@ func IsBundledInDesktopIDE(settings *viper.Viper) bool { logrus.Info("Checking if CLI is Bundled into the IDE") executable, err := os.Executable() if err != nil { - feedback.Errorf("Cannot get executable path: %v", err) + feedback.Errorf(tr("Cannot get executable path: %v"), err) return false } executablePath, err := filepath.EvalSymlinks(executable) if err != nil { - feedback.Errorf("Cannot get executable path: %v", err) + feedback.Errorf(tr("Cannot get executable path: %v"), err) return false } diff --git a/executils/executils.go b/executils/executils.go index bfc3b058daf..573db1a3ded 100644 --- a/executils/executils.go +++ b/executils/executils.go @@ -19,8 +19,12 @@ import ( "bytes" "io" "os/exec" + + "github.com/arduino/arduino-cli/i18n" ) +var tr = i18n.Tr + // PipeCommands executes the commands received as input by feeding the output of // one to the input of the other, exactly like Unix Pipe (|). // Returns the output of the final command and the eventual error. diff --git a/executils/output.go b/executils/output.go index c51c3c850a4..1049ff01699 100644 --- a/executils/output.go +++ b/executils/output.go @@ -31,7 +31,7 @@ type OutputListener interface { func AttachStdoutListener(cmd *exec.Cmd, listener OutputListener) error { stdout, err := cmd.StdoutPipe() if err != nil { - return fmt.Errorf("can't retrieve standard output stream: %s", err) + return fmt.Errorf(tr("can't retrieve standard output stream: %s"), err) } stdoutCopy := bufio.NewScanner(stdout) @@ -49,7 +49,7 @@ func AttachStdoutListener(cmd *exec.Cmd, listener OutputListener) error { func AttachStderrListener(cmd *exec.Cmd, listener OutputListener) error { stderr, err := cmd.StderrPipe() if err != nil { - return fmt.Errorf("can't retrieve standard error stream: %s", err) + return fmt.Errorf(tr("can't retrieve standard error stream: %s"), err) } stderrCopy := bufio.NewScanner(stderr) diff --git a/executils/process.go b/executils/process.go index 714b647d4e5..5c41e97b891 100644 --- a/executils/process.go +++ b/executils/process.go @@ -34,7 +34,7 @@ type Process struct { // arguments to the command. func NewProcess(args ...string) (*Process, error) { if args == nil || len(args) == 0 { - return nil, errors.New("no executable specified") + return nil, errors.New(tr("no executable specified")) } p := &Process{ cmd: exec.Command(args[0], args[1:]...), diff --git a/httpclient/httpclient.go b/httpclient/httpclient.go index 4d097eb6552..f849c75ca63 100644 --- a/httpclient/httpclient.go +++ b/httpclient/httpclient.go @@ -17,8 +17,12 @@ package httpclient import ( "net/http" + + "github.com/arduino/arduino-cli/i18n" ) +var tr = i18n.Tr + // New returns a default http client for use in the cli API calls func New() (*http.Client, error) { config, err := DefaultConfig() diff --git a/httpclient/httpclient_config.go b/httpclient/httpclient_config.go index a038c5f4a13..a60eefec86a 100644 --- a/httpclient/httpclient_config.go +++ b/httpclient/httpclient_config.go @@ -16,7 +16,6 @@ package httpclient import ( - "errors" "fmt" "net/url" "runtime" @@ -42,7 +41,7 @@ func DefaultConfig() (*Config, error) { // this workaround must be here until viper can UnSet properties: // https://github.com/spf13/viper/pull/519 } else if proxy, err = url.Parse(proxyConfig); err != nil { - return nil, errors.New("Invalid network.proxy '" + proxyConfig + "': " + err.Error()) + return nil, fmt.Errorf(tr("Invalid network.proxy '%[1]s': %[2]s"), proxyConfig, err) } } diff --git a/i18n/data/en.po b/i18n/data/en.po index 4fff3d5b394..9c38d4eed42 100644 --- a/i18n/data/en.po +++ b/i18n/data/en.po @@ -1,18 +1,223 @@ msgid "" msgstr "" +#: legacy/builder/resolve_library.go:36 +msgid " -> candidates: %s" +msgstr " -> candidates: %s" + +#: legacy/builder/constants/constants.go:107 +msgid " Not used: {0}" +msgstr " Not used: {0}" + +#: legacy/builder/constants/constants.go:108 +msgid " Used: {0}" +msgstr " Used: {0}" + +#: version/version.go:54 +msgid "%[1]s %[2]s Version: %[3]s Commit: %[4]s Date: %[5]s" +msgstr "%[1]s %[2]s Version: %[3]s Commit: %[4]s Date: %[5]s" + +#: legacy/builder/constants/constants.go:92 +msgid "%[1]s folder is no longer supported! See %[2]s for more information" +msgstr "%[1]s folder is no longer supported! See %[2]s for more information" + +#: cli/output/rpc_progress.go:64 +msgid "%s already downloaded" +msgstr "%s already downloaded" + +#: commands/upload/upload.go:452 +msgid "%s and %s cannot be used together" +msgstr "%s and %s cannot be used together" + +#: cli/debug/debug.go:165 +msgid "%s custom configurations" +msgstr "%s custom configurations" + +#: cli/output/rpc_progress.go:76 +msgid "%s downloaded" +msgstr "%s downloaded" + +#: commands/bundled_tools.go:57 +#: commands/core/install.go:181 +msgid "%s installed" +msgstr "%s installed" + +#: cli/lib/check_deps.go:93 +msgid "%s is already installed." +msgstr "%s is already installed." + +#: arduino/cores/packagemanager/loader.go:70 +msgid "%s is not a directory" +msgstr "%s is not a directory" + +#: arduino/cores/packagemanager/install_uninstall.go:113 +msgid "%s is not managed by package manager" +msgstr "%s is not managed by package manager" + +#: cli/lib/check_deps.go:96 +msgid "%s is required but %s is currently installed." +msgstr "%s is required but %s is currently installed." + +#: cli/lib/check_deps.go:90 +msgid "%s must be installed." +msgstr "%s must be installed." + +#: legacy/builder/builder_utils/utils.go:530 +#: legacy/builder/ctags_runner.go:41 +msgid "%s pattern is missing" +msgstr "%s pattern is missing" + +#: commands/core/uninstall.go:90 +#: commands/core/uninstall.go:106 +#: commands/instances.go:821 +msgid "%s uninstalled" +msgstr "%s uninstalled" + +#: cli/board/listall.go:88 +#: cli/board/search.go:90 +msgid "(hidden)" +msgstr "(hidden)" + +#: legacy/builder/constants/constants.go:105 +msgid "(legacy)" +msgstr "(legacy)" + +#: legacy/builder/constants/constants.go:98 +msgid ", rebuilding all" +msgstr ", rebuilding all" + +#: cli/lib/install.go:71 +msgid "--git-url and --zip-path are disabled by default, for more information see: %v" +msgstr "--git-url and --zip-path are disabled by default, for more information see: %v" + +#: cli/lib/install.go:74 +msgid "--git-url and --zip-path flags allow installing untrusted files, use it at your own risk." +msgstr "--git-url and --zip-path flags allow installing untrusted files, use it at your own risk." + +#: cli/core/download.go:36 +#: cli/core/install.go:37 +#: cli/core/uninstall.go:36 +#: cli/core/upgrade.go:36 +msgid "ARCH" +msgstr "ARCH" + +#: cli/generatedocs/generatedocs.go:79 +msgid "ARDUINO COMMAND LINE MANUAL" +msgstr "ARDUINO COMMAND LINE MANUAL" + #: cli/usage.go:31 msgid "Additional help topics:" msgstr "Additional help topics:" +#: cli/config/add.go:31 +#: cli/config/add.go:32 +msgid "Adds one or more values to a setting." +msgstr "Adds one or more values to a setting." + #: cli/usage.go:26 msgid "Aliases:" msgstr "Aliases:" +#: cli/core/upgrade.go:66 +msgid "All the cores are already at the latest version" +msgstr "All the cores are already at the latest version" + +#: commands/instances.go:693 +#: commands/lib/install.go:92 +msgid "Already installed %s" +msgstr "Already installed %s" + +#: legacy/builder/resolve_library.go:34 +msgid "Alternatives for %[1]s: %[2]s" +msgstr "Alternatives for %[1]s: %[2]s" + +#: cli/lib/search.go:170 +msgid "Architecture: %s" +msgstr "Architecture: %s" + +#: legacy/builder/constants/constants.go:93 +msgid "Archiving built core (caching) in: {0}" +msgstr "Archiving built core (caching) in: {0}" + +#: cli/sketch/sketch.go:31 +#: cli/sketch/sketch.go:32 +msgid "Arduino CLI sketch commands." +msgstr "Arduino CLI sketch commands." + +#: cli/cli.go:67 +msgid "Arduino CLI." +msgstr "Arduino CLI." + +#: cli/cli.go:68 +msgid "Arduino Command Line Interface (arduino-cli)." +msgstr "Arduino Command Line Interface (arduino-cli)." + +#: cli/board/board.go:28 +#: cli/board/board.go:29 +msgid "Arduino board commands." +msgstr "Arduino board commands." + +#: cli/cache/cache.go:31 +#: cli/cache/cache.go:32 +msgid "Arduino cache commands." +msgstr "Arduino cache commands." + +#: cli/lib/lib.go:31 +#: cli/lib/lib.go:32 +msgid "Arduino commands about libraries." +msgstr "Arduino commands about libraries." + +#: cli/config/config.go:31 +msgid "Arduino configuration commands." +msgstr "Arduino configuration commands." + +#: cli/core/core.go:31 +#: cli/core/core.go:32 +msgid "Arduino core operations." +msgstr "Arduino core operations." + +#: cli/lib/check_deps.go:50 +#: cli/lib/install.go:117 +msgid "Arguments error: %v" +msgstr "Arguments error: %v" + +#: cli/board/attach.go:70 +msgid "Attach board error: %v" +msgstr "Attach board error: %v" + +#: cli/board/attach.go:37 +#: cli/board/attach.go:38 +#: cli/board/board.go:32 +msgid "Attaches a sketch to a board." +msgstr "Attaches a sketch to a board." + +#: cli/lib/search.go:161 +msgid "Author: %s" +msgstr "Author: %s" + +#: cli/lib/list.go:125 +msgid "Available" +msgstr "Available" + #: cli/usage.go:28 msgid "Available Commands:" msgstr "Available Commands:" +#: cli/upload/upload.go:62 +msgid "Binary file to upload." +msgstr "Binary file to upload." + +#: cli/board/list.go:92 +#: cli/board/list.go:131 +#: cli/board/listall.go:84 +#: cli/board/search.go:86 +msgid "Board Name" +msgstr "Board Name" + +#: commands/board/attach.go:94 +msgid "Board found: %s" +msgstr "Board found: %s" + #: cli/board/details.go:120 msgid "Board name:" msgstr "Board name:" @@ -21,34 +226,677 @@ msgstr "Board name:" msgid "Board version:" msgstr "Board version:" +#: legacy/builder/constants/constants.go:96 +msgid "Board {0} (platform {1}, package {2}) is unknown" +msgstr "Board {0} (platform {1}, package {2}) is unknown" + +#: legacy/builder/constants/constants.go:97 +msgid "Bootloader file specified but missing: {0}" +msgstr "Bootloader file specified but missing: {0}" + +#: legacy/builder/constants/constants.go:99 +msgid "Build options changed" +msgstr "Build options changed" + +#: cli/compile/compile.go:87 +msgid "Builds of 'core.a' are saved into this path to be cached and reused." +msgstr "Builds of 'core.a' are saved into this path to be cached and reused." + +#: cli/config/set.go:54 +msgid "Can't set multiple values in key %v" +msgstr "Can't set multiple values in key %v" + +#: cli/config/init.go:60 +msgid "Can't use both --dest-file and --dest-dir flags at the same time." +msgstr "Can't use both --dest-file and --dest-dir flags at the same time." + +#: cli/config/add.go:60 +#: cli/config/delete.go:67 +#: cli/config/remove.go:69 +msgid "Can't write config file: %v" +msgstr "Can't write config file: %v" + +#: cli/config/init.go:97 +msgid "Cannot create config file directory: %v" +msgstr "Cannot create config file directory: %v" + +#: cli/config/init.go:106 +msgid "Cannot create config file: %v" +msgstr "Cannot create config file: %v" + +#: commands/debug/debug.go:67 +msgid "Cannot execute debug tool" +msgstr "Cannot execute debug tool" + +#: cli/config/init.go:72 +#: cli/config/init.go:83 +msgid "Cannot find absolute path: %v" +msgstr "Cannot find absolute path: %v" + +#: commands/debug/debug.go:51 +msgid "Cannot get command line for tool" +msgstr "Cannot get command line for tool" + +#: configuration/configuration.go:147 +#: configuration/configuration.go:153 +msgid "Cannot get executable path: %v" +msgstr "Cannot get executable path: %v" + +#: commands/upload/upload.go:351 +msgid "Cannot perform port reset: %s" +msgstr "Cannot perform port reset: %s" + +#: cli/lib/search.go:169 +msgid "Category: %s" +msgstr "Category: %s" + +#: cli/lib/check_deps.go:35 +#: cli/lib/check_deps.go:36 +msgid "Check dependencies status for the specified library." +msgstr "Check dependencies status for the specified library." + +#: legacy/builder/builder_utils/utils.go:280 +msgid "Checking previous results for {0} (result = {1}, dep = {2})" +msgstr "Checking previous results for {0} (result = {1}, dep = {2})" + +#: arduino/resources/checksums.go:182 +msgid "Checksum differs from checksum in package.json" +msgstr "Checksum differs from checksum in package.json" + #: cli/board/details.go:168 msgid "Checksum:" msgstr "Checksum:" +#: cli/cache/cache.go:33 +msgid "Clean caches." +msgstr "Clean caches." + +#: cli/cli.go:106 +msgid "Comma-separated list of additional URLs for the Boards Manager." +msgstr "Comma-separated list of additional URLs for the Boards Manager." + +#: cli/board/list.go:47 +msgid "Command keeps running and prints list of connected boards whenever there is a change." +msgstr "Command keeps running and prints list of connected boards whenever there is a change." + +#: cli/compile/compile.go:73 +#: cli/compile/compile.go:74 +msgid "Compiles Arduino sketches." +msgstr "Compiles Arduino sketches." + +#: legacy/builder/builder.go:81 +msgid "Compiling core..." +msgstr "Compiling core..." + +#: legacy/builder/builder.go:75 +msgid "Compiling libraries..." +msgstr "Compiling libraries..." + +#: legacy/builder/phases/libraries_builder.go:135 +msgid "Compiling library \"{0}\"" +msgstr "Compiling library \"{0}\"" + +#: legacy/builder/builder.go:70 +msgid "Compiling sketch..." +msgstr "Compiling sketch..." + +#: cli/config/init.go:90 +msgid "Config file already exists, use --overwrite to discard the existing one." +msgstr "Config file already exists, use --overwrite to discard the existing one." + +#: cli/config/init.go:110 +msgid "Config file written to: %s" +msgstr "Config file written to: %s" + +#: commands/core/install.go:171 +#: commands/instances.go:828 +msgid "Configuring platform" +msgstr "Configuring platform" + +#: cli/board/list.go:188 +msgid "Connected" +msgstr "Connected" + +#: cli/board/list.go:92 +#: cli/board/list.go:131 +msgid "Core" +msgstr "Core" + +#: cli/outdated/outdated.go:62 +#: cli/update/update.go:99 +msgid "Core name" +msgstr "Core name" + +#: cli/sketch/new.go:58 +msgid "Could not create sketch directory: %v" +msgstr "Could not create sketch directory: %v" + +#: legacy/builder/phases/core_builder.go:48 +msgid "Couldn't deeply cache core build: {0}" +msgstr "Couldn't deeply cache core build: {0}" + +#: legacy/builder/constants/constants.go:127 +msgid "Couldn't determine program size" +msgstr "Couldn't determine program size" + +#: cli/board/attach.go:83 +#: cli/compile/compile.go:238 +#: cli/debug/debug.go:127 +#: cli/lib/install.go:97 +#: cli/upload/upload.go:120 +msgid "Couldn't get current working directory: %v" +msgstr "Couldn't get current working directory: %v" + +#: cli/sketch/new.go:32 +#: cli/sketch/new.go:33 +msgid "Create a new Sketch" +msgstr "Create a new Sketch" + +#: cli/sketch/archive.go:39 +#: cli/sketch/archive.go:40 +msgid "Creates a zip file containing all sketch files." +msgstr "Creates a zip file containing all sketch files." + +#: cli/config/init.go:43 +msgid "Creates or updates the configuration file in the data directory or custom directory with the current configuration settings." +msgstr "Creates or updates the configuration file in the data directory or custom directory with the current configuration settings." + +#: cli/debug/debug.go:56 +msgid "Debug Arduino sketches." +msgstr "Debug Arduino sketches." + +#: cli/debug/debug.go:57 +msgid "Debug Arduino sketches. (this command opens an interactive gdb session)" +msgstr "Debug Arduino sketches. (this command opens an interactive gdb session)" + +#: cli/debug/debug.go:66 +msgid "Debug interpreter e.g.: %s, %s, %s, %s, %s" +msgstr "Debug interpreter e.g.: %s, %s, %s, %s, %s" + +#: cli/debug/debug.go:64 +msgid "Debug port, e.g.: COM10 or /dev/ttyACM0" +msgstr "Debug port, e.g.: COM10 or /dev/ttyACM0" + #: cli/board/details.go:124 msgid "Debugging supported:" msgstr "Debugging supported:" +#: cli/cache/clean.go:31 +msgid "Delete Boards/Library Manager download cache." +msgstr "Delete Boards/Library Manager download cache." + +#: cli/cache/clean.go:32 +msgid "Delete contents of the `directories.downloads` folder, where archive files are staged during installation of libraries and boards platforms." +msgstr "Delete contents of the `directories.downloads` folder, where archive files are staged during installation of libraries and boards platforms." + +#: cli/config/delete.go:32 +#: cli/config/delete.go:33 +msgid "Deletes a settings key and all its sub keys." +msgstr "Deletes a settings key and all its sub keys." + +#: cli/lib/search.go:177 +msgid "Dependencies: %s" +msgstr "Dependencies: %s" + +#: legacy/builder/builder_utils/utils.go:358 +msgid "Depfile is about different file: {0}" +msgstr "Depfile is about different file: {0}" + +#: cli/lib/list.go:125 +msgid "Description" +msgstr "Description" + +#: legacy/builder/builder.go:62 +msgid "Detecting libraries used..." +msgstr "Detecting libraries used..." + +#: cli/board/list.go:38 +msgid "Detects and displays a list of boards connected to the current computer." +msgstr "Detects and displays a list of boards connected to the current computer." + +#: cli/debug/debug.go:67 +msgid "Directory containing binaries for debug." +msgstr "Directory containing binaries for debug." + +#: cli/upload/upload.go:61 +msgid "Directory containing binaries to upload." +msgstr "Directory containing binaries to upload." + +#: cli/generatedocs/generatedocs.go:45 +msgid "Directory where to save generated files. Default is './docs', the directory must exist." +msgstr "Directory where to save generated files. Default is './docs', the directory must exist." + +#: cli/completion/completion.go:44 +msgid "Disable completion description for shells that support it" +msgstr "Disable completion description for shells that support it" + +#: cli/board/list.go:189 +msgid "Disconnected" +msgstr "Disconnected" + +#: cli/lib/install.go:49 +msgid "Do not install dependencies." +msgstr "Do not install dependencies." + +#: cli/burnbootloader/burnbootloader.go:57 +#: cli/upload/upload.go:66 +msgid "Do not perform the actual upload, just log out actions" +msgstr "Do not perform the actual upload, just log out actions" + +#: cli/daemon/daemon.go:58 +msgid "Do not terminate daemon process if the parent process dies" +msgstr "Do not terminate daemon process if the parent process dies" + +#: commands/instances.go:682 +#: commands/instances.go:741 +#: commands/lib/download.go:55 +msgid "Downloading %s" +msgstr "Downloading %s" + +#: commands/instances.go:93 +msgid "Downloading missing tool %s" +msgstr "Downloading missing tool %s" + +#: commands/core/install.go:88 +msgid "Downloading packages" +msgstr "Downloading packages" + +#: cli/core/download.go:37 +#: cli/core/download.go:38 +msgid "Downloads one or more cores and corresponding tool dependencies." +msgstr "Downloads one or more cores and corresponding tool dependencies." + +#: cli/lib/download.go:35 +#: cli/lib/download.go:36 +msgid "Downloads one or more libraries without installing them." +msgstr "Downloads one or more libraries without installing them." + +#: cli/lib/install.go:51 +msgid "Enter a path to zip file" +msgstr "Enter a path to zip file" + +#: cli/lib/install.go:50 +msgid "Enter git url for libraries hosted on repositories" +msgstr "Enter git url for libraries hosted on repositories" + +#: commands/sketch/archive.go:106 +msgid "Error adding file to archive: %v" +msgstr "Error adding file to archive: %v" + +#: legacy/builder/constants/constants.go:94 +msgid "Error archiving built core (caching) in {0}: {1}" +msgstr "Error archiving built core (caching) in {0}: {1}" + +#: cli/sketch/archive.go:85 +msgid "Error archiving: %v" +msgstr "Error archiving: %v" + +#: commands/sketch/archive.go:93 +msgid "Error calculating relative file path: %v" +msgstr "Error calculating relative file path: %v" + +#: cli/cache/clean.go:46 +msgid "Error cleaning caches: %v" +msgstr "Error cleaning caches: %v" + +#: commands/sketch/archive.go:81 +msgid "Error creating archive: %v" +msgstr "Error creating archive: %v" + +#: cli/core/search.go:66 +#: cli/core/update_index.go:52 +#: cli/instance/instance.go:43 +#: cli/lib/search.go:57 +#: cli/lib/update_index.go:45 +#: cli/update/update.go:62 +msgid "Error creating instance: %v" +msgstr "Error creating instance: %v" + +#: cli/sketch/new.go:54 +#: cli/sketch/new.go:64 +msgid "Error creating sketch: %v" +msgstr "Error creating sketch: %v" + +#: cli/board/list.go:75 +#: cli/board/list.go:85 +msgid "Error detecting boards: %v" +msgstr "Error detecting boards: %v" + +#: cli/core/download.go:68 +#: cli/lib/download.go:62 +msgid "Error downloading %[1]s: %[2]v" +msgstr "Error downloading %[1]s: %[2]v" + +#: commands/instances.go:760 +msgid "Error downloading tool %s" +msgstr "Error downloading tool %s" + +#: cli/debug/debug.go:112 +msgid "Error during Debug: %v" +msgstr "Error during Debug: %v" + +#: cli/feedback/feedback.go:134 +msgid "Error during JSON encoding of the output: %v" +msgstr "Error during JSON encoding of the output: %v" + +#: cli/burnbootloader/burnbootloader.go:75 +#: cli/compile/compile.go:213 +#: cli/upload/upload.go:107 +msgid "Error during Upload: %v" +msgstr "Error during Upload: %v" + +#: cli/compile/compile.go:225 +msgid "Error during build: %v" +msgstr "Error during build: %v" + +#: cli/core/install.go:106 +msgid "Error during install: %v" +msgstr "Error during install: %v" + +#: cli/core/uninstall.go:68 +msgid "Error during uninstall: %v" +msgstr "Error during uninstall: %v" + +#: cli/core/upgrade.go:101 +msgid "Error during upgrade: %v" +msgstr "Error during upgrade: %v" + +#: cli/debug/debug.go:96 +#: cli/debug/debug.go:99 +msgid "Error getting Debug info: %v" +msgstr "Error getting Debug info: %v" + +#: commands/sketch/archive.go:59 +msgid "Error getting absolute archive path %v" +msgstr "Error getting absolute archive path %v" + #: cli/board/details.go:71 msgid "Error getting board details: %v" msgstr "Error getting board details: %v" +#: arduino/builder/compilation_database.go:78 +msgid "Error getting current directory for compilation database: %s" +msgstr "Error getting current directory for compilation database: %s" + +#: cli/lib/examples.go:69 +msgid "Error getting libraries info: %v" +msgstr "Error getting libraries info: %v" + +#: legacy/builder/types/context.go:239 +msgid "Error in FQBN: %s" +msgstr "Error in FQBN: %s" + +#: cli/core/search.go:81 +#: cli/instance/instance.go:47 +#: cli/lib/search.go:70 +#: cli/update/update.go:87 +msgid "Error initializing instance: %v" +msgstr "Error initializing instance: %v" + +#: commands/instances.go:787 +msgid "Error installing %s" +msgstr "Error installing %s" + +#: cli/lib/install.go:130 +msgid "Error installing %s: %v" +msgstr "Error installing %s: %v" + +#: cli/lib/install.go:108 +msgid "Error installing Git Library: %v" +msgstr "Error installing Git Library: %v" + +#: cli/lib/install.go:85 +msgid "Error installing Zip Library: %v" +msgstr "Error installing Zip Library: %v" + +#: commands/instances.go:778 +msgid "Error installing tool %s" +msgstr "Error installing tool %s" + +#: cli/lib/list.go:77 +msgid "Error listing Libraries: %v" +msgstr "Error listing Libraries: %v" + +#: cli/board/listall.go:61 +msgid "Error listing boards: %v" +msgstr "Error listing boards: %v" + +#: cli/core/list.go:61 +msgid "Error listing platforms: %v" +msgstr "Error listing platforms: %v" + +#: cli/compile/compile.go:147 +msgid "Error opening source code overrides data file: %v" +msgstr "Error opening source code overrides data file: %v" + +#: configuration/configuration.go:69 +msgid "Error reading config file: %v" +msgstr "Error reading config file: %v" + +#: legacy/builder/target_board_resolver.go:33 +msgid "Error resolving FQBN: {0}" +msgstr "Error resolving FQBN: {0}" + +#: cli/lib/check_deps.go:60 +msgid "Error resolving dependencies for %[1]s: %[2]s" +msgstr "Error resolving dependencies for %[1]s: %[2]s" + +#: commands/lib/install.go:48 +msgid "Error resolving dependencies for %[1]s@%[2]s: %[3]s" +msgstr "Error resolving dependencies for %[1]s@%[2]s: %[3]s" + +#: cli/core/upgrade.go:61 +msgid "Error retrieving core list: %v" +msgstr "Error retrieving core list: %v" + +#: cli/outdated/outdated.go:57 +#: cli/update/update.go:94 +msgid "Error retrieving outdated cores and libraries: %v" +msgstr "Error retrieving outdated cores and libraries: %v" + +#: commands/sketch/archive.go:75 +msgid "Error retrieving sketch files: %v" +msgstr "Error retrieving sketch files: %v" + +#: commands/core/install.go:153 +#: commands/instances.go:802 +msgid "Error rolling-back changes: %s" +msgstr "Error rolling-back changes: %s" + +#: cli/board/search.go:63 +msgid "Error searching boards: %v" +msgstr "Error searching boards: %v" + +#: cli/lib/search.go:79 +msgid "Error searching for Library: %v" +msgstr "Error searching for Library: %v" + +#: cli/core/search.go:93 +msgid "Error searching for platforms: %v" +msgstr "Error searching for platforms: %v" + +#: arduino/builder/compilation_database.go:63 +msgid "Error serializing compilation database: %s" +msgstr "Error serializing compilation database: %s" + +#: cli/lib/uninstall.go:62 +msgid "Error uninstalling %[1]s: %[2]v" +msgstr "Error uninstalling %[1]s: %[2]v" + +#: cli/update/update.go:79 +msgid "Error updating core and libraries index: %v" +msgstr "Error updating core and libraries index: %v" + +#: cli/core/search.go:75 +#: cli/core/update_index.go:69 +msgid "Error updating index: %v" +msgstr "Error updating index: %v" + +#: cli/core/update_index.go:61 +#: cli/lib/update_index.go:54 +#: cli/update/update.go:71 +msgid "Error updating indexes: %v" +msgstr "Error updating indexes: %v" + +#: cli/lib/search.go:65 +#: cli/lib/update_index.go:62 +msgid "Error updating library index: %v" +msgstr "Error updating library index: %v" + +#: cli/lib/upgrade.go:50 +#: cli/lib/upgrade.go:56 +msgid "Error upgrading libraries: %v" +msgstr "Error upgrading libraries: %v" + +#: commands/core/install.go:148 +#: commands/instances.go:797 +msgid "Error upgrading platform: %s" +msgstr "Error upgrading platform: %s" + +#: cli/upgrade/upgrade.go:60 +msgid "Error upgrading: %v" +msgstr "Error upgrading: %v" + +#: legacy/builder/constants/constants.go:104 +msgid "Error while detecting libraries included by {0}" +msgstr "Error while detecting libraries included by {0}" + +#: legacy/builder/phases/sizer.go:135 +#: legacy/builder/phases/sizer.go:141 +msgid "Error while determining sketch size: %s" +msgstr "Error while determining sketch size: %s" + +#: arduino/builder/compilation_database.go:66 +msgid "Error writing compilation database: %s" +msgstr "Error writing compilation database: %s" + +#: cli/completion/completion.go:51 +msgid "Error: command description is not supported by %v" +msgstr "Error: command description is not supported by %v" + +#: cli/compile/compile.go:154 +msgid "Error: invalid source code overrides data file: %v" +msgstr "Error: invalid source code overrides data file: %v" + +#: cli/board/list.go:92 +msgid "Event" +msgstr "Event" + +#: cli/lib/examples.go:118 +msgid "Examples for library %s" +msgstr "Examples for library %s" + #: cli/usage.go:27 msgid "Examples:" msgstr "Examples:" +#: cli/debug/debug.go:146 +msgid "Executable to debug" +msgstr "Executable to debug" + +#: cli/board/attach.go:36 +#: cli/board/details.go:41 +#: cli/board/list.go:92 +#: cli/board/list.go:131 +#: cli/board/listall.go:84 +#: cli/board/search.go:86 +msgid "FQBN" +msgstr "FQBN" + +#: cli/board/details.go:121 +msgid "FQBN:" +msgstr "FQBN:" + +#: cli/daemon/daemon.go:114 +msgid "Failed to listen on TCP port: %[1]s. %[2]s is an invalid port." +msgstr "Failed to listen on TCP port: %[1]s. %[2]s is an invalid port." + +#: cli/daemon/daemon.go:108 +msgid "Failed to listen on TCP port: %[1]s. %[2]s is unknown name." +msgstr "Failed to listen on TCP port: %[1]s. %[2]s is unknown name." + +#: cli/daemon/daemon.go:123 +msgid "Failed to listen on TCP port: %[1]s. Unexpected error: %[2]v" +msgstr "Failed to listen on TCP port: %[1]s. Unexpected error: %[2]v" + +#: cli/daemon/daemon.go:120 +msgid "Failed to listen on TCP port: %s. Address already in use." +msgstr "Failed to listen on TCP port: %s. Address already in use." + +#: legacy/builder/builder_utils/utils.go:380 +msgid "Failed to read: {0}" +msgstr "Failed to read: {0}" + #: cli/board/details.go:166 msgid "File:" msgstr "File:" +#: commands/daemon/debug.go:47 +msgid "First message must contain debug request, not data" +msgstr "First message must contain debug request, not data" + #: cli/usage.go:29 msgid "Flags:" msgstr "Flags:" +#: cli/core/install.go:59 +msgid "Force run of post-install scripts (if the CLI is not running interactively)." +msgstr "Force run of post-install scripts (if the CLI is not running interactively)." + +#: cli/core/install.go:60 +msgid "Force skip of post-install scripts (if the CLI is running interactively)." +msgstr "Force skip of post-install scripts (if the CLI is running interactively)." + +#: cli/board/details.go:50 +#: cli/burnbootloader/burnbootloader.go:52 +#: cli/compile/compile.go:84 +#: cli/debug/debug.go:63 +#: cli/upload/upload.go:59 +msgid "Fully Qualified Board Name, e.g.: arduino:avr:uno" +msgstr "Fully Qualified Board Name, e.g.: arduino:avr:uno" + +#: cli/debug/debug.go:160 +msgid "GDB Server path" +msgstr "GDB Server path" + +#: cli/debug/debug.go:159 +msgid "GDB Server type" +msgstr "GDB Server type" + +#: cli/generatedocs/generatedocs.go:38 +#: cli/generatedocs/generatedocs.go:39 +msgid "Generates bash completion and command manpages." +msgstr "Generates bash completion and command manpages." + +#: cli/completion/completion.go:38 +msgid "Generates completion scripts" +msgstr "Generates completion scripts" + +#: cli/completion/completion.go:39 +msgid "Generates completion scripts for various shells" +msgstr "Generates completion scripts for various shells" + +#: legacy/builder/builder.go:67 +msgid "Generating function prototypes..." +msgstr "Generating function prototypes..." + #: cli/usage.go:30 msgid "Global Flags:" msgstr "Global Flags:" +#: legacy/builder/constants/constants.go:122 +msgid "Global variables use {0} bytes ({2}%%) of dynamic memory, leaving {3} bytes for local variables. Maximum is {1} bytes." +msgstr "Global variables use {0} bytes ({2}%%) of dynamic memory, leaving {3} bytes for local variables. Maximum is {1} bytes." + +#: legacy/builder/constants/constants.go:123 +msgid "Global variables use {0} bytes of dynamic memory." +msgstr "Global variables use {0} bytes of dynamic memory." + +#: cli/core/list.go:84 +#: cli/core/search.go:114 +msgid "ID" +msgstr "ID" + #: cli/board/details.go:93 #: cli/board/details.go:194 msgid "Id" @@ -58,107 +906,2431 @@ msgstr "Id" msgid "Identification properties:" msgstr "Identification properties:" -#: cli/board/details.go:194 -msgid "Name" -msgstr "Name" +#: cli/compile/compile.go:114 +msgid "If set built binaries will be exported to the sketch folder." +msgstr "If set built binaries will be exported to the sketch folder." -#: cli/board/details.go:165 -msgid "OS:" -msgstr "OS:" +#: cli/core/list.go:42 +msgid "If set return all installable and installed cores, including manually installed." +msgstr "If set return all installable and installed cores, including manually installed." -#: cli/board/details.go:129 -msgid "Official Arduino board:" -msgstr "Official Arduino board:" +#: cli/lib/list.go:48 +msgid "Include built-in libraries (from platforms and IDE) in listing." +msgstr "Include built-in libraries (from platforms and IDE) in listing." -#: cli/board/details.go:177 -msgid "Option:" -msgstr "Option:" +#: cli/sketch/archive.go:51 +msgid "Includes %s directory in the archive." +msgstr "Includes %s directory in the archive." -#: cli/board/details.go:145 -msgid "Package URL:" -msgstr "Package URL:" +#: cli/core/list.go:84 +#: cli/lib/list.go:125 +msgid "Installed" +msgstr "Installed" -#: cli/board/details.go:144 -msgid "Package maintainer:" -msgstr "Package maintainer:" +#: commands/instances.go:707 +#: commands/lib/install.go:108 +msgid "Installed %s" +msgstr "Installed %s" -#: cli/board/details.go:143 -msgid "Package name:" -msgstr "Package name:" +#: commands/lib/install.go:118 +msgid "Installed Archived Library" +msgstr "Installed Archived Library" -#: cli/board/details.go:147 -msgid "Package online help:" -msgstr "Package online help:" +#: commands/lib/install.go:128 +msgid "Installed Library from Git URL" +msgstr "Installed Library from Git URL" -#: cli/board/details.go:146 -msgid "Package website:" -msgstr "Package website:" +#: cli/outdated/outdated.go:62 +#: cli/outdated/outdated.go:72 +#: cli/update/update.go:99 +#: cli/update/update.go:109 +msgid "Installed version" +msgstr "Installed version" -#: cli/board/details.go:153 -msgid "Platform URL:" -msgstr "Platform URL:" +#: commands/bundled_tools.go:50 +#: commands/core/install.go:113 +#: commands/instances.go:690 +#: commands/lib/install.go:88 +msgid "Installing %s" +msgstr "Installing %s" -#: cli/board/details.go:152 -msgid "Platform architecture:" -msgstr "Platform architecture:" +#: cli/core/install.go:38 +#: cli/core/install.go:39 +msgid "Installs one or more cores and corresponding tool dependencies." +msgstr "Installs one or more cores and corresponding tool dependencies." -#: cli/board/details.go:151 -msgid "Platform category:" -msgstr "Platform category:" +#: cli/lib/install.go:39 +#: cli/lib/install.go:40 +msgid "Installs one or more specified libraries into the system." +msgstr "Installs one or more specified libraries into the system." -#: cli/board/details.go:158 -msgid "Platform checksum:" -msgstr "Platform checksum:" +#: legacy/builder/container_find_includes.go:378 +msgid "Internal error in cache" +msgstr "Internal error in cache" -#: cli/board/details.go:154 -msgid "Platform file name:" -msgstr "Platform file name:" +#: cli/cli.go:224 +msgid "Invalid Call : should show Help, but it is available only in TEXT mode." +msgstr "Invalid Call : should show Help, but it is available only in TEXT mode." -#: cli/board/details.go:150 -msgid "Platform name:" -msgstr "Platform name:" +#: commands/instances.go:193 +msgid "Invalid additional URL: %v" +msgstr "Invalid additional URL: %v" -#: cli/board/details.go:156 -msgid "Platform size (bytes):" -msgstr "Platform size (bytes):" +#: cli/core/download.go:55 +#: cli/core/install.go:92 +#: cli/core/uninstall.go:51 +#: cli/core/upgrade.go:79 +#: cli/lib/download.go:50 +#: cli/lib/uninstall.go:51 +msgid "Invalid argument passed: %v" +msgstr "Invalid argument passed: %v" -#: cli/board/details.go:42 -msgid "Print details about a board." -msgstr "Print details about a board." +#: legacy/builder/phases/sizer.go:160 +msgid "Invalid data size regexp: %s" +msgstr "Invalid data size regexp: %s" -#: cli/board/details.go:93 -msgid "Programmer name" -msgstr "Programmer name" +#: legacy/builder/phases/sizer.go:166 +msgid "Invalid eeprom size regexp: %s" +msgstr "Invalid eeprom size regexp: %s" -#: cli/board/details.go:194 -msgid "Programmers:" -msgstr "Programmers:" +#: commands/instances.go:175 +msgid "Invalid instance ID" +msgstr "Invalid instance ID" -#: cli/board/details.go:162 -msgid "Required tool:" -msgstr "Required tool:" +#: cli/core/upgrade.go:85 +msgid "Invalid item %s" +msgstr "Invalid item %s" -#: cli/board/details.go:49 -msgid "Show full board details" -msgstr "Show full board details" +#: httpclient/httpclient_config.go:44 +msgid "Invalid network.proxy '%[1]s': %[2]s" +msgstr "Invalid network.proxy '%[1]s': %[2]s" + +#: cli/cli.go:185 +msgid "Invalid option for --log-level: %s" +msgstr "Invalid option for --log-level: %s" + +#: cli/cli.go:202 +msgid "Invalid output format: %s" +msgstr "Invalid output format: %s" + +#: cli/core/uninstall.go:57 +msgid "Invalid parameter %s: version not allowed" +msgstr "Invalid parameter %s: version not allowed" + +#: commands/board/list.go:52 +msgid "Invalid pid value: '%s'" +msgstr "Invalid pid value: '%s'" + +#: legacy/builder/phases/sizer.go:150 +msgid "Invalid size regexp: %s" +msgstr "Invalid size regexp: %s" + +#: cli/board/list.go:66 +msgid "Invalid timeout: %v" +msgstr "Invalid timeout: %v" + +#: commands/board/list.go:49 +msgid "Invalid vid value: '%s'" +msgstr "Invalid vid value: '%s'" + +#: cli/compile/compile.go:109 +msgid "Just produce the compilation database, without actually compiling." +msgstr "Just produce the compilation database, without actually compiling." + +#: cli/lib/list.go:37 +msgid "LIBNAME" +msgstr "LIBNAME" + +#: cli/lib/check_deps.go:34 +#: cli/lib/install.go:38 +msgid "LIBRARY" +msgstr "LIBRARY" + +#: cli/lib/download.go:34 +#: cli/lib/examples.go:38 +#: cli/lib/search.go:39 +#: cli/lib/uninstall.go:35 +msgid "LIBRARY_NAME" +msgstr "LIBRARY_NAME" + +#: cli/core/list.go:84 +msgid "Latest" +msgstr "Latest" + +#: commands/lib/uninstall.go:37 +msgid "Library %s is not installed" +msgstr "Library %s is not installed" + +#: legacy/builder/constants/constants.go:109 +msgid "Library can't use both '%[1]s' and '%[2]s' folders. Double check {0}" +msgstr "Library can't use both '%[1]s' and '%[2]s' folders. Double check {0}" + +#: cli/outdated/outdated.go:72 +#: cli/update/update.go:109 +msgid "Library name" +msgstr "Library name" + +#: legacy/builder/phases/libraries_builder.go:91 +msgid "Library {0} has been declared precompiled:" +msgstr "Library {0} has been declared precompiled:" + +#: cli/lib/search.go:167 +msgid "License: %s" +msgstr "License: %s" + +#: legacy/builder/builder.go:86 +msgid "Linking everything together..." +msgstr "Linking everything together..." + +#: cli/board/listall.go:37 +#: cli/board/search.go:38 +msgid "List all boards that have the support platform installed. You can search\n" +"for a specific board if you specify the board name" +msgstr "List all boards that have the support platform installed. You can search\n" +"for a specific board if you specify the board name" + +#: cli/board/listall.go:36 +#: cli/board/search.go:37 +msgid "List all known boards and their corresponding FQBN." +msgstr "List all known boards and their corresponding FQBN." + +#: cli/board/list.go:37 +msgid "List connected boards." +msgstr "List connected boards." + +#: cli/compile/compile.go:92 +msgid "List of custom build properties separated by commas. Or can be used multiple times for multiple properties." +msgstr "List of custom build properties separated by commas. Or can be used multiple times for multiple properties." + +#: cli/compile/compile.go:106 +msgid "List of custom libraries dir paths separated by commas. Or can be used multiple times for multiple libraries dir paths." +msgstr "List of custom libraries dir paths separated by commas. Or can be used multiple times for multiple libraries dir paths." + +#: cli/compile/compile.go:104 +msgid "List of paths to libraries root folders. Libraries set this way have top priority in case of conflicts. Can be used multiple times for different libraries." +msgstr "List of paths to libraries root folders. Libraries set this way have top priority in case of conflicts. Can be used multiple times for different libraries." + +#: cli/lib/list.go:50 +msgid "List updatable libraries." +msgstr "List updatable libraries." + +#: cli/core/list.go:41 +msgid "List updatable platforms." +msgstr "List updatable platforms." + +#: cli/board/board.go:30 +msgid "Lists all connected boards." +msgstr "Lists all connected boards." + +#: cli/outdated/outdated.go:38 +msgid "Lists cores and libraries that can be upgraded" +msgstr "Lists cores and libraries that can be upgraded" + +#: commands/instances.go:207 +#: commands/instances.go:218 +#: commands/instances.go:301 +msgid "Loading index file: %v" +msgstr "Loading index file: %v" + +#: commands/instances.go:310 +msgid "Loading libraries: %v" +msgstr "Loading libraries: %v" + +#: cli/lib/list.go:125 +msgid "Location" +msgstr "Location" + +#: legacy/builder/constants/constants.go:111 +msgid "Looking for recipes like {0}*{1}" +msgstr "Looking for recipes like {0}*{1}" + +#: legacy/builder/constants/constants.go:126 +msgid "Low memory available, stability problems may occur." +msgstr "Low memory available, stability problems may occur." + +#: cli/lib/search.go:162 +msgid "Maintainer: %s" +msgstr "Maintainer: %s" + +#: cli/cli.go:101 +msgid "Messages with this level and above will be logged. Valid levels are: %s, %s, %s, %s, %s, %s, %s" +msgstr "Messages with this level and above will be logged. Valid levels are: %s, %s, %s, %s, %s, %s, %s" + +#: legacy/builder/constants/constants.go:117 +msgid "Missing '{0}' from library in {1}" +msgstr "Missing '{0}' from library in {1}" + +#: legacy/builder/phases/sizer.go:154 +msgid "Missing size regexp" +msgstr "Missing size regexp" + +#: legacy/builder/constants/constants.go:106 +msgid "Multiple libraries were found for \"{0}\"" +msgstr "Multiple libraries were found for \"{0}\"" + +#: cli/board/details.go:194 +#: cli/core/list.go:84 +#: cli/core/search.go:114 +#: cli/lib/list.go:125 +msgid "Name" +msgstr "Name" + +#: cli/lib/search.go:141 +msgid "Name: \"%s\"" +msgstr "Name: \"%s\"" + +#: cli/outdated/outdated.go:62 +#: cli/outdated/outdated.go:72 +#: cli/update/update.go:99 +#: cli/update/update.go:109 +msgid "New version" +msgstr "New version" + +#: cli/board/list.go:121 +msgid "No boards found." +msgstr "No boards found." + +#: legacy/builder/builder_utils/utils.go:351 +msgid "No colon in first line of depfile" +msgstr "No colon in first line of depfile" + +#: cli/lib/examples.go:103 +msgid "No libraries found." +msgstr "No libraries found." + +#: cli/lib/list.go:117 +msgid "No libraries installed." +msgstr "No libraries installed." + +#: cli/lib/search.go:125 +msgid "No libraries matching your search." +msgstr "No libraries matching your search." + +#: cli/lib/search.go:136 +msgid "No libraries matching your search.\n" +"Did you mean...\n" +"" +msgstr "No libraries matching your search.\n" +"Did you mean...\n" +"" + +#: cli/core/search.go:124 +msgid "No platforms matching your search." +msgstr "No platforms matching your search." + +#: cli/lib/list.go:115 +msgid "No updates available." +msgstr "No updates available." + +#: commands/upload/upload.go:340 +msgid "No upload port found, using %s as fallback" +msgstr "No upload port found, using %s as fallback" + +#: legacy/builder/constants/constants.go:125 +msgid "Not enough memory; see %s for tips on reducing your footprint." +msgstr "Not enough memory; see %s for tips on reducing your footprint." + +#: legacy/builder/builder_utils/utils.go:284 +msgid "Not found: nil" +msgstr "Not found: nil" + +#: legacy/builder/builder_utils/utils.go:300 +#: legacy/builder/builder_utils/utils.go:313 +#: legacy/builder/builder_utils/utils.go:387 +msgid "Not found: {0}" +msgstr "Not found: {0}" + +#: cli/board/details.go:165 +msgid "OS:" +msgstr "OS:" + +#: cli/board/details.go:129 +msgid "Official Arduino board:" +msgstr "Official Arduino board:" + +#: cli/board/details.go:177 +msgid "Option:" +msgstr "Option:" + +#: cli/compile/compile.go:96 +msgid "Optional, can be \"%[1]s\", \"%[2]s\", \"%[3]s\" and \"%[4]s\". Defaults to \"%[1]s\". Used to tell gcc which warning level to use (-W flag)." +msgstr "Optional, can be \"%[1]s\", \"%[2]s\", \"%[3]s\" and \"%[4]s\". Defaults to \"%[1]s\". Used to tell gcc which warning level to use (-W flag)." + +#: cli/compile/compile.go:110 +msgid "Optional, cleanup the build folder and do not use any cached build." +msgstr "Optional, cleanup the build folder and do not use any cached build." + +#: cli/compile/compile.go:107 +msgid "Optional, optimize compile output for debugging, rather than for release." +msgstr "Optional, optimize compile output for debugging, rather than for release." + +#: cli/compile/compile.go:98 +msgid "Optional, suppresses almost every output." +msgstr "Optional, suppresses almost every output." + +#: cli/compile/compile.go:97 +#: cli/upload/upload.go:64 +msgid "Optional, turns on verbose mode." +msgstr "Optional, turns on verbose mode." + +#: cli/compile/compile.go:108 +#: cli/upload/upload.go:65 +msgid "Optional, use the specified programmer to upload." +msgstr "Optional, use the specified programmer to upload." + +#: cli/compile/compile.go:115 +msgid "Optional. Path to a .json file that contains a set of replacements of the sketch source code." +msgstr "Optional. Path to a .json file that contains a set of replacements of the sketch source code." + +#: commands/daemon/monitor.go:72 +msgid "OutputRate in Null monitor must be a float64" +msgstr "OutputRate in Null monitor must be a float64" + +#: cli/compile/compile.go:94 +msgid "Override a build property with a custom value. Can be used multiple times for multiple properties." +msgstr "Override a build property with a custom value. Can be used multiple times for multiple properties." + +#: cli/config/init.go:54 +msgid "Overwrite existing config file." +msgstr "Overwrite existing config file." + +#: cli/core/download.go:36 +#: cli/core/install.go:37 +#: cli/core/uninstall.go:36 +#: cli/core/upgrade.go:36 +msgid "PACKAGER" +msgstr "PACKAGER" + +#: cli/board/details.go:145 +msgid "Package URL:" +msgstr "Package URL:" + +#: cli/board/details.go:144 +msgid "Package maintainer:" +msgstr "Package maintainer:" + +#: cli/board/details.go:143 +msgid "Package name:" +msgstr "Package name:" + +#: cli/board/details.go:147 +msgid "Package online help:" +msgstr "Package online help:" + +#: cli/board/details.go:146 +msgid "Package website:" +msgstr "Package website:" + +#: cli/lib/search.go:164 +msgid "Paragraph: %s" +msgstr "Paragraph: %s" + +#: cli/cli.go:102 +msgid "Path to the file where logs will be written." +msgstr "Path to the file where logs will be written." + +#: cli/compile/compile.go:90 +msgid "Path where to save compiled files. If omitted, a directory will be created in the default temporary path of your OS." +msgstr "Path where to save compiled files. If omitted, a directory will be created in the default temporary path of your OS." + +#: commands/upload/upload.go:319 +msgid "Performing 1200-bps touch reset on serial port %s" +msgstr "Performing 1200-bps touch reset on serial port %s" + +#: commands/core/install.go:74 +msgid "Platform %s already installed" +msgstr "Platform %s already installed" + +#: cli/core/upgrade.go:99 +msgid "Platform %s is already at the latest version" +msgstr "Platform %s is already at the latest version" + +#: cli/board/search.go:86 +msgid "Platform ID" +msgstr "Platform ID" + +#: cli/board/details.go:153 +msgid "Platform URL:" +msgstr "Platform URL:" + +#: cli/board/details.go:152 +msgid "Platform architecture:" +msgstr "Platform architecture:" + +#: cli/board/details.go:151 +msgid "Platform category:" +msgstr "Platform category:" + +#: cli/board/details.go:158 +msgid "Platform checksum:" +msgstr "Platform checksum:" + +#: cli/board/details.go:154 +msgid "Platform file name:" +msgstr "Platform file name:" + +#: cli/board/details.go:150 +msgid "Platform name:" +msgstr "Platform name:" + +#: cli/board/details.go:156 +msgid "Platform size (bytes):" +msgstr "Platform size (bytes):" + +#: legacy/builder/constants/constants.go:115 +msgid "Platform {0} (package {1}) is unknown" +msgstr "Platform {0} (package {1}) is unknown" + +#: cli/board/list.go:92 +#: cli/board/list.go:131 +msgid "Port" +msgstr "Port" + +#: legacy/builder/phases/libraries_builder.go:101 +#: legacy/builder/phases/libraries_builder.go:109 +msgid "Precompiled library in \"{0}\" not found" +msgstr "Precompiled library in \"{0}\" not found" + +#: cli/board/details.go:42 +msgid "Print details about a board." +msgstr "Print details about a board." + +#: cli/compile/compile.go:86 +msgid "Print preprocessed code to stdout instead of compiling." +msgstr "Print preprocessed code to stdout instead of compiling." + +#: cli/cli.go:100 +msgid "Print the logs on the standard output." +msgstr "Print the logs on the standard output." + +#: cli/config/dump.go:31 +msgid "Prints the current configuration" +msgstr "Prints the current configuration" + +#: cli/config/dump.go:32 +msgid "Prints the current configuration." +msgstr "Prints the current configuration." + +#: cli/board/details.go:93 +msgid "Programmer name" +msgstr "Programmer name" + +#: cli/debug/debug.go:65 +msgid "Programmer to use for debugging" +msgstr "Programmer to use for debugging" + +#: cli/board/details.go:194 +msgid "Programmers:" +msgstr "Programmers:" + +#: legacy/builder/constants/constants.go:116 +msgid "Progress {0}" +msgstr "Progress {0}" + +#: cli/lib/search.go:174 +msgid "Provides includes: %s" +msgstr "Provides includes: %s" + +#: cli/config/remove.go:31 +#: cli/config/remove.go:32 +msgid "Removes one or more values from a setting." +msgstr "Removes one or more values from a setting." + +#: commands/instances.go:700 +#: commands/lib/install.go:101 +msgid "Replacing %[1]s with %[2]s" +msgstr "Replacing %[1]s with %[2]s" + +#: cli/board/details.go:162 +msgid "Required tool:" +msgstr "Required tool:" + +#: cli/daemon/daemon.go:50 +msgid "Run as a daemon on port %s" +msgstr "Run as a daemon on port %s" + +#: cli/daemon/daemon.go:51 +msgid "Running as a daemon the initialization of cores and libraries is done only once." +msgstr "Running as a daemon the initialization of cores and libraries is done only once." + +#: legacy/builder/phases/core_builder.go:49 +msgid "Running normal build of the core..." +msgstr "Running normal build of the core..." + +#: legacy/builder/constants/constants.go:119 +msgid "Running recipe: {0}" +msgstr "Running recipe: {0}" + +#: cli/compile/compile.go:88 +msgid "Save build artifacts in this directory." +msgstr "Save build artifacts in this directory." + +#: cli/core/search.go:50 +msgid "Search for a core in Boards Manager using the specified keywords." +msgstr "Search for a core in Boards Manager using the specified keywords." + +#: cli/core/search.go:49 +msgid "Search for a core in Boards Manager." +msgstr "Search for a core in Boards Manager." + +#: cli/lib/search.go:41 +msgid "Search for one or more libraries data (case insensitive search)." +msgstr "Search for one or more libraries data (case insensitive search)." + +#: cli/lib/search.go:40 +msgid "Searches for one or more libraries data." +msgstr "Searches for one or more libraries data." + +#: legacy/builder/constants/constants.go:113 +msgid "Selected board depends on '{0}' core (not installed)." +msgstr "Selected board depends on '{0}' core (not installed)." + +#: commands/board/attach.go:109 +msgid "Selected fqbn: %s" +msgstr "Selected fqbn: %s" + +#: cli/lib/search.go:163 +msgid "Sentence: %s" +msgstr "Sentence: %s" + +#: cli/config/set.go:32 +#: cli/config/set.go:33 +msgid "Sets a setting value." +msgstr "Sets a setting value." + +#: cli/config/init.go:52 +#: cli/config/init.go:53 +msgid "Sets where to save the configuration file." +msgstr "Sets where to save the configuration file." + +#: legacy/builder/constants/constants.go:120 +msgid "Setting build path to {0}" +msgstr "Setting build path to {0}" + +#: cli/config/delete.go:57 +#: cli/config/validate.go:43 +msgid "Settings key doesn't exist" +msgstr "Settings key doesn't exist" + +#: cli/core/search.go:55 +msgid "Show all available core versions." +msgstr "Show all available core versions." + +#: cli/compile/compile.go:85 +msgid "Show all build properties used instead of compiling." +msgstr "Show all build properties used instead of compiling." + +#: cli/board/listall.go:45 +#: cli/board/search.go:46 +msgid "Show also boards marked as 'hidden' in the platform" +msgstr "Show also boards marked as 'hidden' in the platform" + +#: cli/board/details.go:49 +msgid "Show full board details" +msgstr "Show full board details" #: cli/board/details.go:43 msgid "Show information about a board, in particular if the board has options to be specified in the FQBN." msgstr "Show information about a board, in particular if the board has options to be specified in the FQBN." +#: cli/lib/examples.go:45 +#: cli/lib/list.go:49 +msgid "Show libraries for the specified board FQBN." +msgstr "Show libraries for the specified board FQBN." + +#: cli/lib/search.go:46 +msgid "Show library names only." +msgstr "Show library names only." + #: cli/board/details.go:51 msgid "Show list of available programmers" msgstr "Show list of available programmers" +#: cli/debug/debug.go:68 +msgid "Show metadata about the debug session instead of starting the debugger." +msgstr "Show metadata about the debug session instead of starting the debugger." + +#: cli/update/update.go:46 +msgid "Show outdated cores and libraries after index update" +msgstr "Show outdated cores and libraries after index update" + +#: cli/lib/list.go:38 +msgid "Shows a list of installed libraries." +msgstr "Shows a list of installed libraries." + +#: cli/lib/list.go:39 +msgid "Shows a list of installed libraries.\n" +"\n" +"If the LIBNAME parameter is specified the listing is limited to that specific\n" +"library. By default the libraries provided as built-in by platforms/core are\n" +"not listed, they can be listed by adding the --all flag." +msgstr "Shows a list of installed libraries.\n" +"\n" +"If the LIBNAME parameter is specified the listing is limited to that specific\n" +"library. By default the libraries provided as built-in by platforms/core are\n" +"not listed, they can be listed by adding the --all flag." + +#: cli/core/list.go:35 +#: cli/core/list.go:36 +msgid "Shows the list of installed platforms." +msgstr "Shows the list of installed platforms." + +#: cli/lib/examples.go:39 +msgid "Shows the list of the examples for libraries." +msgstr "Shows the list of the examples for libraries." + +#: cli/lib/examples.go:40 +msgid "Shows the list of the examples for libraries. A name may be given as argument to search a specific library." +msgstr "Shows the list of the examples for libraries. A name may be given as argument to search a specific library." + +#: cli/version/version.go:34 +msgid "Shows the version number of Arduino CLI which is installed on your system." +msgstr "Shows the version number of Arduino CLI which is installed on your system." + +#: cli/version/version.go:33 +msgid "Shows version number of Arduino CLI." +msgstr "Shows version number of Arduino CLI." + #: cli/board/details.go:167 msgid "Size (bytes):" msgstr "Size (bytes):" -#: cli/usage.go:25 -msgid "Usage:" -msgstr "Usage:" +#: legacy/builder/constants/constants.go:128 +msgid "Sketch cannot be located in build path. Please specify a different build path" +msgstr "Sketch cannot be located in build path. Please specify a different build path" -#: cli/usage.go:32 -msgid "Use %s for more information about a command." -msgstr "Use %s for more information about a command." +#: cli/sketch/new.go:68 +msgid "Sketch created in: %s" +msgstr "Sketch created in: %s" + +#: legacy/builder/constants/constants.go:124 +msgid "Sketch too big; see %s for tips on reducing it." +msgstr "Sketch too big; see %s for tips on reducing it." + +#: legacy/builder/constants/constants.go:121 +msgid "Sketch uses {0} bytes ({2}%%) of program storage space. Maximum is {1} bytes." +msgstr "Sketch uses {0} bytes ({2}%%) of program storage space. Maximum is {1} bytes." + +#: cli/compile/compile.go:137 +#: cli/sketch/archive.go:66 +#: cli/upload/upload.go:89 +msgid "Sketches with .pde extension are deprecated, please rename the following files to .ino:" +msgstr "Sketches with .pde extension are deprecated, please rename the following files to .ino:" + +#: legacy/builder/phases/linker.go:35 +msgid "Skip linking of final executable." +msgstr "Skip linking of final executable." + +#: commands/upload/upload.go:312 +msgid "Skipping 1200-bps touch reset: no serial port selected!" +msgstr "Skipping 1200-bps touch reset: no serial port selected!" + +#: legacy/builder/builder_utils/utils.go:476 +msgid "Skipping archive creation of: {0}" +msgstr "Skipping archive creation of: {0}" + +#: legacy/builder/builder_utils/utils.go:269 +msgid "Skipping compile of: {0}" +msgstr "Skipping compile of: {0}" + +#: legacy/builder/constants/constants.go:103 +msgid "Skipping dependencies detection for precompiled library {0}" +msgstr "Skipping dependencies detection for precompiled library {0}" + +#: commands/core/install.go:177 +#: commands/instances.go:834 +msgid "Skipping platform configuration" +msgstr "Skipping platform configuration" + +#: legacy/builder/recipe_runner.go:58 +msgid "Skipping: {0}" +msgstr "Skipping: {0}" + +#: arduino/serialutils/serialutils.go:133 +msgid "TOUCH: error during reset: %s" +msgstr "TOUCH: error during reset: %s" + +#: cli/daemon/daemon.go:56 +msgid "The TCP port the daemon will listen to" +msgstr "The TCP port the daemon will listen to" + +#: cli/board/attach.go:46 +#: cli/board/list.go:45 +msgid "The connected devices search timeout, raise it if your board doesn't show up (e.g. to %s)." +msgstr "The connected devices search timeout, raise it if your board doesn't show up (e.g. to %s)." + +#: cli/cli.go:105 +msgid "The custom config file (if not specified the default will be used)." +msgstr "The custom config file (if not specified the default will be used)." + +#: cli/core/install.go:66 +msgid "The flags --run-post-install and --skip-post-install can't be both set at the same time." +msgstr "The flags --run-post-install and --skip-post-install can't be both set at the same time." + +#: cli/config/add.go:51 +msgid "The key '%[1]v' is not a list of items, can't add to it.\n" +"Maybe use '%[2]s'?" +msgstr "The key '%[1]v' is not a list of items, can't add to it.\n" +"Maybe use '%[2]s'?" + +#: cli/config/remove.go:51 +msgid "The key '%[1]v' is not a list of items, can't remove from it.\n" +"Maybe use '%[2]s'?" +msgstr "The key '%[1]v' is not a list of items, can't remove from it.\n" +"Maybe use '%[2]s'?" + +#: cli/cli.go:103 +msgid "The output format for the logs, can be {%s|%s}." +msgstr "The output format for the logs, can be {%s|%s}." + +#: cli/cli.go:104 +msgid "The output format, can be {%s|%s}." +msgstr "The output format, can be {%s|%s}." + +#: legacy/builder/phases/libraries_builder.go:151 +msgid "The platform does not support '{0}' for precompiled libraries." +msgstr "The platform does not support '{0}' for precompiled libraries." + +#: cli/lib/upgrade.go:34 +msgid "This command upgrades an installed library to the latest available version. Multiple libraries can be passed separated by a space. If no arguments are provided, the command will upgrade all the installed libraries where an update is available." +msgstr "This command upgrades an installed library to the latest available version. Multiple libraries can be passed separated by a space. If no arguments are provided, the command will upgrade all the installed libraries where an update is available." + +#: cli/outdated/outdated.go:39 +msgid "This commands shows a list of installed cores and/or libraries\n" +"that can be upgraded. If nothing needs to be updated the output is empty." +msgstr "This commands shows a list of installed cores and/or libraries\n" +"that can be upgraded. If nothing needs to be updated the output is empty." + +#: commands/bundled_tools.go:45 +#: commands/core/install.go:81 +#: commands/instances.go:751 +msgid "Tool %s already installed" +msgstr "Tool %s already installed" + +#: cli/debug/debug.go:154 +msgid "Toolchain custom configurations" +msgstr "Toolchain custom configurations" + +#: cli/debug/debug.go:148 +msgid "Toolchain path" +msgstr "Toolchain path" + +#: cli/debug/debug.go:149 +msgid "Toolchain prefix" +msgstr "Toolchain prefix" + +#: cli/debug/debug.go:147 +msgid "Toolchain type" +msgstr "Toolchain type" + +#: legacy/builder/constants/constants.go:118 +msgid "Ts: {0} - Running: {1}" +msgstr "Ts: {0} - Running: {1}" + +#: cli/burnbootloader/burnbootloader.go:55 +msgid "Turns on verbose mode." +msgstr "Turns on verbose mode." + +#: cli/board/list.go:92 +#: cli/board/list.go:131 +msgid "Type" +msgstr "Type" + +#: cli/lib/search.go:171 +msgid "Types: %s" +msgstr "Types: %s" + +#: cli/board/details.go:169 +msgid "URL:" +msgstr "URL:" + +#: legacy/builder/constants/constants.go:95 +msgid "Unable to cache built core, please tell {0} maintainers to follow %s" +msgstr "Unable to cache built core, please tell {0} maintainers to follow %s" + +#: legacy/builder/constants/constants.go:101 +msgid "Unable to find {0} in {1}" +msgstr "Unable to find {0} in {1}" + +#: configuration/configuration.go:125 +msgid "Unable to get Documents Folder: %v" +msgstr "Unable to get Documents Folder: %v" + +#: configuration/configuration.go:100 +msgid "Unable to get Local App Data Folder: %v" +msgstr "Unable to get Local App Data Folder: %v" + +#: configuration/configuration.go:88 +#: configuration/configuration.go:113 +msgid "Unable to get user home dir: %v" +msgstr "Unable to get user home dir: %v" + +#: cli/cli.go:171 +msgid "Unable to open file for logging: %s" +msgstr "Unable to open file for logging: %s" + +#: commands/core/uninstall.go:82 +#: commands/lib/uninstall.go:39 +msgid "Uninstalling %s" +msgstr "Uninstalling %s" + +#: commands/core/uninstall.go:98 +#: commands/instances.go:813 +msgid "Uninstalling %s, tool is no more required" +msgstr "Uninstalling %s, tool is no more required" + +#: cli/core/uninstall.go:37 +#: cli/core/uninstall.go:38 +msgid "Uninstalls one or more cores and corresponding tool dependencies if no longer used." +msgstr "Uninstalls one or more cores and corresponding tool dependencies if no longer used." + +#: cli/lib/uninstall.go:36 +#: cli/lib/uninstall.go:37 +msgid "Uninstalls one or more libraries." +msgstr "Uninstalls one or more libraries." + +#: cli/board/list.go:161 +msgid "Unknown" +msgstr "Unknown" + +#: legacy/builder/constants/constants.go:129 +msgid "Unknown sketch file extension: {0}" +msgstr "Unknown sketch file extension: {0}" + +#: cli/update/update.go:40 +msgid "Updates the index of cores and libraries" +msgstr "Updates the index of cores and libraries" + +#: cli/update/update.go:41 +msgid "Updates the index of cores and libraries to the latest versions." +msgstr "Updates the index of cores and libraries to the latest versions." + +#: cli/core/update_index.go:36 +msgid "Updates the index of cores to the latest version." +msgstr "Updates the index of cores to the latest version." + +#: cli/core/update_index.go:35 +msgid "Updates the index of cores." +msgstr "Updates the index of cores." + +#: cli/lib/update_index.go:35 +msgid "Updates the libraries index to the latest version." +msgstr "Updates the libraries index to the latest version." + +#: cli/lib/update_index.go:34 +msgid "Updates the libraries index." +msgstr "Updates the libraries index." + +#: commands/instances.go:773 +msgid "Updating %s" +msgstr "Updating %s" + +#: commands/instances.go:431 +#: commands/instances.go:457 +#: commands/instances.go:487 +msgid "Updating index: %s" +msgstr "Updating index: %s" + +#: commands/instances.go:358 +msgid "Updating index: library_index.json.gz" +msgstr "Updating index: library_index.json.gz" + +#: commands/instances.go:368 +msgid "Updating index: library_index.json.sig" +msgstr "Updating index: library_index.json.sig" + +#: cli/upgrade/upgrade.go:40 +msgid "Upgrades installed cores and libraries to latest version." +msgstr "Upgrades installed cores and libraries to latest version." + +#: cli/upgrade/upgrade.go:39 +msgid "Upgrades installed cores and libraries." +msgstr "Upgrades installed cores and libraries." + +#: cli/lib/upgrade.go:33 +msgid "Upgrades installed libraries." +msgstr "Upgrades installed libraries." + +#: cli/core/upgrade.go:37 +#: cli/core/upgrade.go:38 +msgid "Upgrades one or all installed platforms to the latest version." +msgstr "Upgrades one or all installed platforms to the latest version." + +#: commands/core/install.go:117 +msgid "Upgrading %[1]s with %[2]s" +msgstr "Upgrading %[1]s with %[2]s" + +#: cli/upload/upload.go:51 +msgid "Upload Arduino sketches." +msgstr "Upload Arduino sketches." + +#: cli/upload/upload.go:52 +msgid "Upload Arduino sketches. This does NOT compile the sketch prior to upload." +msgstr "Upload Arduino sketches. This does NOT compile the sketch prior to upload." + +#: commands/upload/upload.go:337 +msgid "Upload port found on %s" +msgstr "Upload port found on %s" + +#: cli/burnbootloader/burnbootloader.go:53 +#: cli/compile/compile.go:100 +#: cli/upload/upload.go:60 +msgid "Upload port, e.g.: COM10 or /dev/ttyACM0" +msgstr "Upload port, e.g.: COM10 or /dev/ttyACM0" + +#: cli/compile/compile.go:99 +msgid "Upload the binary after the compilation." +msgstr "Upload the binary after the compilation." + +#: cli/burnbootloader/burnbootloader.go:46 +msgid "Upload the bootloader on the board using an external programmer." +msgstr "Upload the bootloader on the board using an external programmer." + +#: cli/burnbootloader/burnbootloader.go:45 +msgid "Upload the bootloader." +msgstr "Upload the bootloader." + +#: cli/usage.go:25 +msgid "Usage:" +msgstr "Usage:" + +#: cli/usage.go:32 +msgid "Use %s for more information about a command." +msgstr "Use %s for more information about a command." + +#: cli/burnbootloader/burnbootloader.go:56 +msgid "Use the specified programmer to upload." +msgstr "Use the specified programmer to upload." + +#: arduino/libraries/librariesmanager/install.go:62 +#: arduino/libraries/librariesmanager/install.go:78 +#: arduino/libraries/librariesmanager/install.go:100 +#: arduino/libraries/librariesmanager/install.go:184 +msgid "User directory not set" +msgstr "User directory not set" + +#: legacy/builder/constants/constants.go:132 +msgid "Using board '{0}' from platform in folder: {1}" +msgstr "Using board '{0}' from platform in folder: {1}" + +#: legacy/builder/constants/constants.go:135 +msgid "Using cached library dependencies for file: {0}" +msgstr "Using cached library dependencies for file: {0}" + +#: legacy/builder/constants/constants.go:133 +msgid "Using core '{0}' from platform in folder: {1}" +msgstr "Using core '{0}' from platform in folder: {1}" + +#: legacy/builder/constants/constants.go:130 +msgid "Using library {0} at version {1} in folder: {2} {3}" +msgstr "Using library {0} at version {1} in folder: {2} {3}" + +#: legacy/builder/constants/constants.go:131 +msgid "Using library {0} in folder: {1} {2}" +msgstr "Using library {0} in folder: {1} {2}" + +#: legacy/builder/phases/core_builder.go:107 +msgid "Using precompiled core: {0}" +msgstr "Using precompiled core: {0}" + +#: legacy/builder/phases/libraries_builder.go:98 +#: legacy/builder/phases/libraries_builder.go:106 +msgid "Using precompiled library in {0}" +msgstr "Using precompiled library in {0}" + +#: legacy/builder/constants/constants.go:134 +msgid "Using previously compiled file: {0}" +msgstr "Using previously compiled file: {0}" + +#: cli/core/download.go:36 +#: cli/core/install.go:37 +msgid "VERSION" +msgstr "VERSION" + +#: cli/lib/check_deps.go:34 +#: cli/lib/install.go:38 +msgid "VERSION_NUMBER" +msgstr "VERSION_NUMBER" + +#: cli/burnbootloader/burnbootloader.go:54 +#: cli/compile/compile.go:101 +#: cli/upload/upload.go:63 +msgid "Verify uploaded binary after the upload." +msgstr "Verify uploaded binary after the upload." + +#: cli/core/search.go:114 +msgid "Version" +msgstr "Version" + +#: cli/lib/search.go:172 +msgid "Versions: %s" +msgstr "Versions: %s" + +#: legacy/builder/constants/constants.go:136 +msgid "WARNING: Category '{0}' in library {1} is not valid. Setting to '{2}'" +msgstr "WARNING: Category '{0}' in library {1} is not valid. Setting to '{2}'" + +#: legacy/builder/constants/constants.go:138 +msgid "WARNING: Spurious {0} folder in '{1}' library" +msgstr "WARNING: Spurious {0} folder in '{1}' library" + +#: commands/core/install.go:173 +#: commands/instances.go:830 +msgid "WARNING: cannot run post install: %s" +msgstr "WARNING: cannot run post install: %s" + +#: legacy/builder/constants/constants.go:110 +msgid "WARNING: library {0} claims to run on {1} architecture(s) and may be incompatible with your current board which runs on {2} architecture(s)." +msgstr "WARNING: library {0} claims to run on {1} architecture(s) and may be incompatible with your current board which runs on {2} architecture(s)." + +#: commands/upload/upload.go:326 +msgid "Waiting for upload port..." +msgstr "Waiting for upload port..." + +#: legacy/builder/constants/constants.go:112 +msgid "Warning: Board {0}:{1}:{2} doesn''t define a %s preference. Auto-set to: {3}" +msgstr "Warning: Board {0}:{1}:{2} doesn''t define a %s preference. Auto-set to: {3}" + +#: legacy/builder/constants/constants.go:137 +msgid "Warning: platform.txt from core '{0}' contains deprecated {1}, automatically converted to {2}. Consider upgrading this core." +msgstr "Warning: platform.txt from core '{0}' contains deprecated {1}, automatically converted to {2}. Consider upgrading this core." + +#: commands/upload/upload.go:229 +msgid "Warning: tool '%s' is not installed. It might not be available for your OS." +msgstr "Warning: tool '%s' is not installed. It might not be available for your OS." + +#: cli/lib/search.go:165 +msgid "Website: %s" +msgstr "Website: %s" + +#: cli/compile/compile.go:102 +msgid "When specified, VID/PID specific build properties are used, if board supports them." +msgstr "When specified, VID/PID specific build properties are used, if board supports them." + +#: cli/config/init.go:42 +msgid "Writes current configuration to a configuration file." +msgstr "Writes current configuration to a configuration file." + +#: cli/config/init.go:45 +msgid "Writes current configuration to the configuration file in the data directory." +msgstr "Writes current configuration to the configuration file in the data directory." + +#: cli/config/set.go:76 +msgid "Writing config file: %v" +msgstr "Writing config file: %v" + +#: cli/core/list.go:88 +#: cli/core/search.go:118 +msgid "[DEPRECATED] %s" +msgstr "[DEPRECATED] %s" + +#: commands/upload/upload.go:235 +msgid "a programmer is required to upload for this board" +msgstr "a programmer is required to upload for this board" + +#: arduino/discovery/discovery.go:340 +msgid "already in events mode" +msgstr "already in events mode" + +#: commands/sketch/archive.go:70 +msgid "archive already exists" +msgstr "archive already exists" + +#: arduino/resources/checksums.go:80 +msgid "archive hash differs from hash in index" +msgstr "archive hash differs from hash in index" + +#: arduino/libraries/librariesmanager/install.go:131 +msgid "archive is not valid: multiple files found in zip file top level" +msgstr "archive is not valid: multiple files found in zip file top level" + +#: cli/sketch/archive.go:38 +msgid "archivePath" +msgstr "archivePath" + +#: legacy/builder/preprocess_sketch.go:103 +msgid "arduino-preprocessor pattern is missing" +msgstr "arduino-preprocessor pattern is missing" + +#: commands/upload/upload.go:477 +msgid "autodetect build artifact: %s" +msgstr "autodetect build artifact: %s" + +#: commands/upload/upload.go:462 +msgid "binary file not found in %s" +msgstr "binary file not found in %s" + +#: arduino/cores/packagemanager/package_manager.go:180 +msgid "board %s:%s not found" +msgstr "board %s:%s not found" + +#: commands/board/list.go:40 +msgid "board not found" +msgstr "board not found" + +#: cli/board/listall.go:35 +#: cli/board/search.go:36 +msgid "boardname" +msgstr "boardname" + +#: commands/upload/upload.go:376 +msgid "burn bootloader error: %s" +msgstr "burn bootloader error: %s" + +#: commands/instances.go:506 +msgid "can't create data directory %[1]s: %[2]s" +msgstr "can't create data directory %[1]s: %[2]s" + +#: commands/core/install.go:130 +msgid "can't find dependencies for platform %[1]s: %[2]w" +msgstr "can't find dependencies for platform %[1]s: %[2]w" + +#: arduino/cores/status.go:123 +msgid "can't find latest release of %s" +msgstr "can't find latest release of %s" + +#: arduino/sketch/sketch.go:100 +msgid "can't find main Sketch file in %s" +msgstr "can't find main Sketch file in %s" + +#: executils/output.go:52 +msgid "can't retrieve standard error stream: %s" +msgstr "can't retrieve standard error stream: %s" + +#: executils/output.go:34 +msgid "can't retrieve standard output stream: %s" +msgstr "can't retrieve standard output stream: %s" + +#: commands/compile/compile.go:181 +msgid "cannot create build cache directory: %s" +msgstr "cannot create build cache directory: %s" + +#: commands/compile/compile.go:151 +msgid "cannot create build directory: %s" +msgstr "cannot create build directory: %s" + +#: commands/upload/upload.go:419 +#: commands/upload/upload.go:426 +msgid "cannot execute upload tool: %s" +msgstr "cannot execute upload tool: %s" + +#: commands/board/attach.go:107 +msgid "cannot export sketch metadata: %s" +msgstr "cannot export sketch metadata: %s" + +#: commands/upload/upload.go:180 +msgid "cannot get programmer tool: undefined '%s' property" +msgstr "cannot get programmer tool: undefined '%s' property" + +#: commands/instances.go:696 +#: commands/lib/install.go:97 +msgid "checking lib install prerequisites: %s" +msgstr "checking lib install prerequisites: %s" + +#: arduino/resources/install.go:39 +msgid "checking local archive integrity" +msgstr "checking local archive integrity" + +#: commands/upload/upload.go:373 +msgid "chip erase error: %s" +msgstr "chip erase error: %s" + +#: legacy/builder/wipeout_build_path_if_build_options_changed.go:85 +#: legacy/builder/wipeout_build_path_if_build_options_changed.go:89 +msgid "cleaning build path" +msgstr "cleaning build path" + +#: cli/cli.go:69 +msgid "command" +msgstr "command" + +#: arduino/discovery/discovery.go:229 +#: arduino/discovery/discovery.go:247 +#: arduino/discovery/discovery.go:264 +#: arduino/discovery/discovery.go:286 +#: arduino/discovery/discovery.go:309 +#: arduino/discovery/discovery.go:351 +msgid "command failed: %s" +msgstr "command failed: %s" + +#: arduino/discovery/discovery.go:227 +msgid "communication out of sync, expected 'hello', received '%s'" +msgstr "communication out of sync, expected 'hello', received '%s'" + +#: arduino/discovery/discovery.go:307 +msgid "communication out of sync, expected 'list', received '%s'" +msgstr "communication out of sync, expected 'list', received '%s'" + +#: arduino/discovery/discovery.go:284 +msgid "communication out of sync, expected 'quit', received '%s'" +msgstr "communication out of sync, expected 'quit', received '%s'" + +#: arduino/discovery/discovery.go:245 +msgid "communication out of sync, expected 'start', received '%s'" +msgstr "communication out of sync, expected 'start', received '%s'" + +#: arduino/discovery/discovery.go:349 +msgid "communication out of sync, expected 'start_sync', received '%s'" +msgstr "communication out of sync, expected 'start_sync', received '%s'" + +#: arduino/discovery/discovery.go:262 +msgid "communication out of sync, expected 'stop', received '%s'" +msgstr "communication out of sync, expected 'stop', received '%s'" + +#: commands/debug/debug_info.go:123 +#: commands/upload/upload.go:286 +msgid "compiled sketch not found in %s" +msgstr "compiled sketch not found in %s" + +#: arduino/resources/checksums.go:76 +msgid "computing hash: %s" +msgstr "computing hash: %s" + +#: commands/compile/compile.go:282 +#: commands/lib/list.go:108 +msgid "converting library %[1]s to rpc struct: %[2]w" +msgstr "converting library %[1]s to rpc struct: %[2]w" + +#: commands/compile/compile.go:273 +msgid "copying output file %s" +msgstr "copying output file %s" + +#: commands/upload/upload.go:534 +msgid "could not find a valid build artifact" +msgstr "could not find a valid build artifact" + +#: arduino/cores/packagemanager/install_uninstall.go:45 +msgid "creating installed.json in %[1]s: %[2]s" +msgstr "creating installed.json in %[1]s: %[2]s" + +#: commands/compile/compile.go:253 +msgid "creating output dir" +msgstr "creating output dir" + +#: arduino/resources/install.go:44 +#: arduino/resources/install.go:48 +msgid "creating temp dir for extraction: %s" +msgstr "creating temp dir for extraction: %s" + +#: commands/instances.go:440 +#: commands/instances.go:442 +msgid "creating temp file for index download: %s" +msgstr "creating temp file for index download: %s" + +#: commands/instances.go:473 +#: commands/instances.go:475 +msgid "creating temp file for index signature download: %s" +msgstr "creating temp file for index signature download: %s" + +#: legacy/builder/phases/sizer.go:116 +msgid "data section exceeds available space in board" +msgstr "data section exceeds available space in board" + +#: commands/debug/debug_info.go:149 +msgid "debugging not supported for board %s" +msgstr "debugging not supported for board %s" + +#: arduino/sketch/sketch.go:206 +msgid "decoding sketch metadata: %s" +msgstr "decoding sketch metadata: %s" + +#: commands/lib/resolve_deps.go:51 +msgid "dependency '%s' is not available" +msgstr "dependency '%s' is not available" + +#: legacy/builder/utils/utils.go:471 +msgid "destination already exists" +msgstr "destination already exists" + +#: arduino/libraries/librariesmanager/install.go:69 +msgid "destination dir %s already exists, cannot install" +msgstr "destination dir %s already exists, cannot install" + +#: cli/core/download.go:36 +msgid "download [%s:%s[@%s]]..." +msgstr "download [%s:%s[@%s]]..." + +#: cli/core/install.go:42 +msgid "download a specific version (in this case 1.6.9)." +msgstr "download a specific version (in this case 1.6.9)." + +#: cli/core/install.go:40 +msgid "download the latest version of Arduino SAMD core." +msgstr "download the latest version of Arduino SAMD core." + +#: commands/instances.go:95 +msgid "downloading %[1]s tool: %[2]s" +msgstr "downloading %[1]s tool: %[2]s" + +#: commands/instances.go:450 +#: commands/instances.go:454 +#: commands/instances.go:459 +msgid "downloading index %[1]s: %[2]s" +msgstr "downloading index %[1]s: %[2]s" + +#: commands/instances.go:489 +msgid "downloading index signature %[1]s: %[2]s" +msgstr "downloading index signature %[1]s: %[2]s" + +#: commands/lib/install.go:72 +msgid "downloading library: %s" +msgstr "downloading library: %s" + +#: commands/instances.go:359 +msgid "downloading library_index.json.gz" +msgstr "downloading library_index.json.gz" + +#: commands/instances.go:369 +msgid "downloading library_index.json.sig" +msgstr "downloading library_index.json.sig" + +#: commands/core/download.go:61 +msgid "downloading tool %[1]s: %[2]s" +msgstr "downloading tool %[1]s: %[2]s" + +#: arduino/sketch/sketch.go:195 +msgid "encoding sketch metadata: %s" +msgstr "encoding sketch metadata: %s" + +#: commands/board/list.go:145 +msgid "error getting board info from Arduino Cloud" +msgstr "error getting board info from Arduino Cloud" + +#: commands/board/list.go:198 +msgid "error getting port list from %s" +msgstr "error getting port list from %s" + +#: commands/instances.go:848 +msgid "error loading sketch %[1]v: %[2]v" +msgstr "error loading sketch %[1]v: %[2]v" + +#: arduino/monitors/serial.go:44 +msgid "error opening serial monitor" +msgstr "error opening serial monitor" + +#: commands/debug/debug_info.go:65 +msgid "error parsing FQBN" +msgstr "error parsing FQBN" + +#: cli/config/set.go:68 +msgid "error parsing value: %v" +msgstr "error parsing value: %v" + +#: commands/board/list.go:82 +msgid "error processing response from server" +msgstr "error processing response from server" + +#: commands/board/list.go:99 +msgid "error querying Arduino Cloud Api" +msgstr "error querying Arduino Cloud Api" + +#: commands/debug/debug_info.go:71 +msgid "error resolving FQBN" +msgstr "error resolving FQBN" + +#: cli/upload/upload.go:73 +msgid "error: %s and %s flags cannot be used together" +msgstr "error: %s and %s flags cannot be used together" + +#: commands/debug/debug_info.go:126 +#: commands/upload/upload.go:289 +msgid "expected compiled sketch in directory %s, but is a file instead" +msgstr "expected compiled sketch in directory %s, but is a file instead" + +#: arduino/resources/install.go:67 +msgid "extracting archive: %s" +msgstr "extracting archive: %s" + +#: arduino/libraries/librariesmanager/install.go:119 +msgid "extracting archive: %w" +msgstr "extracting archive: %w" + +#: arduino/resources/checksums.go:145 +msgid "failed to compute hash of file \"%s\"" +msgstr "failed to compute hash of file \"%s\"" + +#: commands/board/list.go:65 +msgid "failed to initialize http client" +msgstr "failed to initialize http client" + +#: arduino/resources/checksums.go:97 +msgid "fetched archive size differs from size specified in index" +msgstr "fetched archive size differs from size specified in index" + +#: arduino/resources/install.go:132 +msgid "files in archive must be placed in a subdirectory" +msgstr "files in archive must be placed in a subdirectory" + +#: arduino/cores/packagemanager/loader.go:65 +msgid "find abs path: %s" +msgstr "find abs path: %s" + +#: commands/core/download.go:50 +msgid "find platform dependencies: %s" +msgstr "find platform dependencies: %s" + +#: commands/core/install.go:49 +#: commands/core/uninstall.go:56 +msgid "finding platform dependencies: %s" +msgstr "finding platform dependencies: %s" + +#: commands/daemon/monitor.go:45 +msgid "first message must contain monitor configuration, not data" +msgstr "first message must contain monitor configuration, not data" + +#: cli/cli.go:69 +msgid "flags" +msgstr "flags" + +#: arduino/cores/packagemanager/loader.go:107 +msgid "following possible symlink %[1]s: %[2]s" +msgstr "following possible symlink %[1]s: %[2]s" + +#: cli/core/download.go:41 +msgid "for a specific version (in this case 1.6.9)." +msgstr "for a specific version (in this case 1.6.9)." + +#: cli/lib/download.go:39 +msgid "for a specific version." +msgstr "for a specific version." + +#: cli/lib/check_deps.go:38 +#: cli/lib/download.go:38 +#: cli/lib/install.go:42 +msgid "for the latest version." +msgstr "for the latest version." + +#: cli/lib/check_deps.go:39 +#: cli/lib/install.go:43 +msgid "for the specific version." +msgstr "for the specific version." + +#: arduino/libraries/libraries.go:114 +msgid "gathering library headers: %w" +msgstr "gathering library headers: %w" + +#: inventory/inventory.go:67 +msgid "generating installation.id: %w" +msgstr "generating installation.id: %w" + +#: inventory/inventory.go:73 +msgid "generating installation.secret: %w" +msgstr "generating installation.secret: %w" + +#: arduino/resources/helpers.go:68 +msgid "getting archive file info: %s" +msgstr "getting archive file info: %s" + +#: arduino/resources/checksums.go:94 +msgid "getting archive info: %s" +msgstr "getting archive info: %s" + +#: arduino/resources/checksums.go:67 +#: arduino/resources/checksums.go:90 +#: arduino/resources/helpers.go:40 +#: arduino/resources/helpers.go:49 +#: arduino/resources/install.go:55 +msgid "getting archive path: %s" +msgstr "getting archive path: %s" + +#: arduino/cores/packagemanager/package_manager.go:186 +msgid "getting build properties for board %[1]s: %[2]s" +msgstr "getting build properties for board %[1]s: %[2]s" + +#: arduino/cores/packagemanager/download.go:103 +msgid "getting discovery dependencies for platform %[1]s: %[2]s" +msgstr "getting discovery dependencies for platform %[1]s: %[2]s" + +#: arduino/cores/packagemanager/loader.go:564 +msgid "getting parent dir of %[1]s: %[2]s" +msgstr "getting parent dir of %[1]s: %[2]s" + +#: commands/bundled_tools_serial_discovery.go:138 +msgid "getting port list from discovery: %v" +msgstr "getting port list from discovery: %v" + +#: arduino/cores/packagemanager/download.go:96 +msgid "getting tool dependencies for platform %[1]s: %[2]s" +msgstr "getting tool dependencies for platform %[1]s: %[2]s" + +#: arduino/sketch/sketch.go:150 +msgid "importing sketch metadata: %s" +msgstr "importing sketch metadata: %s" + +#: commands/compile/compile.go:115 +#: commands/upload/programmers_list.go:37 +#: commands/upload/programmers_list.go:43 +#: commands/upload/upload.go:131 +#: commands/upload/upload.go:138 +msgid "incorrect FQBN: %s" +msgstr "incorrect FQBN: %s" + +#: commands/instances.go:497 +msgid "index has an invalid signature" +msgstr "index has an invalid signature" + +#: arduino/libraries/librariesmanager/install.go:86 +msgid "install directory not set" +msgstr "install directory not set" + +#: commands/instances.go:99 +msgid "installing %[1]s tool: %[2]s" +msgstr "installing %[1]s tool: %[2]s" + +#: arduino/cores/packagemanager/install_uninstall.go:37 +msgid "installing platform %[1]s: %[2]s" +msgstr "installing platform %[1]s: %[2]s" + +#: commands/bundled_tools.go:54 +msgid "installing tool %[1]s: %[2]s" +msgstr "installing tool %[1]s: %[2]s" + +#: arduino/discovery/discovery.go:134 +msgid "invalid 'add' message: missing port" +msgstr "invalid 'add' message: missing port" + +#: arduino/discovery/discovery.go:145 +msgid "invalid 'remove' message: missing port" +msgstr "invalid 'remove' message: missing port" + +#: commands/upload/upload.go:196 +msgid "invalid 'upload.tool' property: %s" +msgstr "invalid 'upload.tool' property: %s" + +#: commands/board/attach.go:66 +#: commands/upload/upload.go:115 +msgid "invalid Device URL format: %s" +msgstr "invalid Device URL format: %s" + +#: arduino/resources/checksums.go:45 +msgid "invalid checksum format: %s" +msgstr "invalid checksum format: %s" + +#: commands/board/attach.go:76 +msgid "invalid device port type provided" +msgstr "invalid device port type provided" + +#: cli/globals/args.go:82 +msgid "invalid empty core architecture '%s'" +msgstr "invalid empty core architecture '%s'" + +#: cli/globals/args.go:58 +msgid "invalid empty core argument" +msgstr "invalid empty core argument" + +#: cli/globals/args.go:78 +msgid "invalid empty core name '%s'" +msgstr "invalid empty core name '%s'" + +#: cli/globals/args.go:62 +msgid "invalid empty core reference '%s'" +msgstr "invalid empty core reference '%s'" + +#: cli/globals/args.go:67 +msgid "invalid empty core version: '%s'" +msgstr "invalid empty core version: '%s'" + +#: cli/lib/args.go:49 +msgid "invalid empty library name" +msgstr "invalid empty library name" + +#: cli/lib/args.go:54 +msgid "invalid empty library version: %s" +msgstr "invalid empty library version: %s" + +#: arduino/cores/board.go:123 +msgid "invalid empty option found" +msgstr "invalid empty option found" + +#: arduino/cores/fqbn.go:54 +#: arduino/cores/fqbn.go:59 +msgid "invalid fqbn config: %s" +msgstr "invalid fqbn config: %s" + +#: arduino/cores/fqbn.go:48 +msgid "invalid fqbn: empty board identifier" +msgstr "invalid fqbn: empty board identifier" + +#: arduino/libraries/librariesmanager/install.go:250 +msgid "invalid git url" +msgstr "invalid git url" + +#: commands/instances.go:325 +#: commands/instances.go:337 +#: commands/instances.go:406 +#: commands/instances.go:668 +#: commands/instances.go:713 +msgid "invalid handle" +msgstr "invalid handle" + +#: arduino/resources/checksums.go:49 +msgid "invalid hash '%[1]s': %[2]s" +msgstr "invalid hash '%[1]s': %[2]s" + +#: commands/board/attach.go:42 +#: commands/board/details.go:33 +#: commands/board/list.go:193 +#: commands/board/listall.go:36 +#: commands/board/search.go:36 +#: commands/compile/compile.go:93 +#: commands/core/download.go:36 +#: commands/core/install.go:35 +#: commands/core/list.go:38 +#: commands/core/search.go:40 +#: commands/core/uninstall.go:33 +#: commands/core/upgrade.go:40 +#: commands/instances.go:547 +#: commands/instances.go:570 +#: commands/lib/list.go:41 +#: commands/lib/list.go:46 +#: commands/lib/search.go:35 +msgid "invalid instance" +msgstr "invalid instance" + +#: cli/globals/args.go:75 +msgid "invalid item %s" +msgstr "invalid item %s" + +#: arduino/libraries/libraries_layout.go:53 +msgid "invalid library layout value: %d" +msgstr "invalid library layout value: %d" + +#: arduino/libraries/libraries_layout.go:68 +msgid "invalid library layout: %s" +msgstr "invalid library layout: %s" + +#: arduino/libraries/libraries_location.go:73 +msgid "invalid library location value: %d" +msgstr "invalid library location value: %d" + +#: arduino/libraries/libraries_location.go:94 +msgid "invalid library location: %s" +msgstr "invalid library location: %s" + +#: arduino/cores/board.go:125 +msgid "invalid option '%s'" +msgstr "invalid option '%s'" + +#: commands/instances.go:426 +#: commands/instances.go:502 +msgid "invalid package index in %[1]s: %[2]s" +msgstr "invalid package index in %[1]s: %[2]s" + +#: inventory/inventory.go:85 +msgid "invalid path creating config dir: %[1]s error: %[2]w" +msgstr "invalid path creating config dir: %[1]s error: %[2]w" + +#: inventory/inventory.go:91 +msgid "invalid path writing inventory file: %[1]s error: %[2]w" +msgstr "invalid path writing inventory file: %[1]s error: %[2]w" + +#: arduino/cores/packageindex/index.go:239 +msgid "invalid platform archive size: %s" +msgstr "invalid platform archive size: %s" + +#: commands/upload/upload.go:406 +msgid "invalid recipe '%[1]s': %[2]s" +msgstr "invalid recipe '%[1]s': %[2]s" + +#: arduino/cores/board.go:109 +msgid "invalid value '%[1]s' for option '%[2]s'" +msgstr "invalid value '%[1]s' for option '%[2]s'" + +#: arduino/cores/packagemanager/loader.go:279 +msgid "invalid version dir %[1]s: %[2]s" +msgstr "invalid version dir %[1]s: %[2]s" + +#: commands/core/download.go:41 +#: commands/core/install.go:40 +#: commands/lib/utils.go:34 +msgid "invalid version: %s" +msgstr "invalid version: %s" + +#: commands/daemon/settings.go:108 +msgid "key not found in settings" +msgstr "key not found in settings" + +#: cli/core/search.go:48 +msgid "keywords" +msgstr "keywords" + +#: arduino/libraries/librariesmanager/install.go:157 +#: arduino/libraries/librariesmanager/install.go:200 +msgid "library %s already installed" +msgstr "library %s already installed" + +#: commands/lib/utils.go:47 +msgid "library %s not found" +msgstr "library %s not found" + +#: arduino/libraries/librariesmanager/install.go:38 +msgid "library already installed" +msgstr "library already installed" + +#: arduino/libraries/librariesmanager/install.go:269 +msgid "library is not valid: missing file \"library.properties\"" +msgstr "library is not valid: missing file \"library.properties\"" + +#: arduino/libraries/librariesmanager/install.go:264 +msgid "library is not valid: missing header file \"%s\"" +msgstr "library is not valid: missing header file \"%s\"" + +#: arduino/libraries/librariesmanager/librariesmanager.go:226 +msgid "library path does not exist: %s" +msgstr "library path does not exist: %s" + +#: commands/instances.go:385 +msgid "library_index.json has an invalid signature" +msgstr "library_index.json has an invalid signature" + +#: arduino/serialutils/serialutils.go:61 +msgid "listing serial ports" +msgstr "listing serial ports" + +#: arduino/cores/packagemanager/loader.go:306 +#: arduino/cores/packagemanager/loader.go:315 +#: arduino/cores/packagemanager/loader.go:320 +msgid "loading %[1]s: %[2]s" +msgstr "loading %[1]s: %[2]s" + +#: commands/board/details.go:44 +#: commands/lib/list.go:60 +msgid "loading board data: %s" +msgstr "loading board data: %s" + +#: arduino/cores/packagemanager/loader.go:349 +msgid "loading boards: %s" +msgstr "loading boards: %s" + +#: arduino/cores/packagemanager/loader.go:519 +msgid "loading bundled tools from %[1]s: %[2]s" +msgstr "loading bundled tools from %[1]s: %[2]s" + +#: arduino/cores/packagemanager/package_manager.go:221 +#: arduino/cores/packagemanager/package_manager.go:236 +msgid "loading json index file %[1]s: %[2]s" +msgstr "loading json index file %[1]s: %[2]s" + +#: arduino/libraries/librariesmanager/librariesmanager.go:205 +#: arduino/libraries/librariesmanager/librariesmanager.go:231 +msgid "loading library from %[1]s: %[2]s" +msgstr "loading library from %[1]s: %[2]s" + +#: arduino/libraries/loader.go:47 +msgid "loading library.properties: %s" +msgstr "loading library.properties: %s" + +#: arduino/cores/packagemanager/loader.go:255 +#: arduino/cores/packagemanager/loader.go:283 +msgid "loading platform release %[1]s: %[2]s" +msgstr "loading platform release %[1]s: %[2]s" + +#: arduino/cores/packagemanager/loader.go:206 +msgid "loading platform.txt: %v" +msgstr "loading platform.txt: %v" + +#: arduino/cores/packagemanager/loader.go:486 +msgid "loading tool release in %[1]s: %[2]s" +msgstr "loading tool release in %[1]s: %[2]s" + +#: arduino/cores/packagemanager/loader.go:199 +msgid "looking for boards.txt in %[1]s: %[2]s" +msgstr "looking for boards.txt in %[1]s: %[2]s" + +#: commands/lib/download.go:42 +#: commands/lib/install.go:68 +#: commands/lib/resolve_deps.go:34 +msgid "looking for library: %s" +msgstr "looking for library: %s" + +#: legacy/builder/container_setup.go:74 +msgid "main file missing from sketch" +msgstr "main file missing from sketch" + +#: commands/compile/compile.go:259 +msgid "missing 'build.project_name' build property" +msgstr "missing 'build.project_name' build property" + +#: arduino/resources/checksums.go:41 +msgid "missing checksum for: %s" +msgstr "missing checksum for: %s" + +#: arduino/cores/packagemanager/package_manager.go:198 +msgid "missing package %[1]s referenced by board %[2]s" +msgstr "missing package %[1]s referenced by board %[2]s" + +#: arduino/cores/packagemanager/package_manager.go:203 +msgid "missing platform %[1]s:%[2]s referenced by board %[3]s" +msgstr "missing platform %[1]s:%[2]s referenced by board %[3]s" + +#: arduino/cores/packagemanager/package_manager.go:208 +msgid "missing platform release %[1]s:%[2]s referenced by board %[3]s" +msgstr "missing platform release %[1]s:%[2]s referenced by board %[3]s" + +#: commands/bundled_tools_serial_discovery.go:119 +#: commands/bundled_tools_serial_discovery.go:148 +msgid "missing serial-discovery tool" +msgstr "missing serial-discovery tool" + +#: commands/compile/compile.go:98 +#: commands/debug/debug_info.go:47 +msgid "missing sketchPath" +msgstr "missing sketchPath" + +#: arduino/libraries/librariesmanager/install.go:174 +#: arduino/resources/install.go:94 +msgid "moving extracted archive to destination dir: %s" +msgstr "moving extracted archive to destination dir: %s" + +#: commands/upload/upload.go:529 +msgid "multiple build artifacts found: '%[1]s' and '%[2]s'" +msgstr "multiple build artifacts found: '%[1]s' and '%[2]s'" + +#: arduino/sketch/sketch.go:73 +msgid "multiple main sketch files found (%[1]v, %[2]v)" +msgstr "multiple main sketch files found (%[1]v, %[2]v)" + +#: commands/compile/compile.go:111 +msgid "no FQBN provided" +msgstr "no FQBN provided" + +#: commands/debug/debug_info.go:61 +#: commands/upload/programmers_list.go:33 +#: commands/upload/upload.go:127 +msgid "no Fully Qualified Board Name provided" +msgstr "no Fully Qualified Board Name provided" + +#: arduino/cores/packagemanager/install_uninstall.go:127 +msgid "no compatible version of %s tools found for the current os" +msgstr "no compatible version of %s tools found for the current os" + +#: executils/process.go:37 +msgid "no executable specified" +msgstr "no executable specified" + +#: commands/daemon/daemon.go:82 +msgid "no instance specified" +msgstr "no instance specified" + +#: commands/upload/upload.go:108 +msgid "no programmer specified for burning bootloader" +msgstr "no programmer specified for burning bootloader" + +#: commands/upload/upload.go:484 +msgid "no sketch or build directory/file specified" +msgstr "no sketch or build directory/file specified" + +#: commands/board/attach.go:92 +msgid "no supported board found at %s" +msgstr "no supported board found at %s" + +#: arduino/resources/install.go:128 +msgid "no unique root dir in archive, found '%[1]s' and '%[2]s'" +msgstr "no unique root dir in archive, found '%[1]s' and '%[2]s'" + +#: commands/upload/upload.go:401 +msgid "no upload port provided" +msgstr "no upload port provided" + +#: arduino/sketch/sketch.go:258 +msgid "no valid sketch found in %[1]s: missing %[2]s" +msgstr "no valid sketch found in %[1]s: missing %[2]s" + +#: commands/lib/resolve_deps.go:56 +msgid "no valid solution found" +msgstr "no valid solution found" + +#: arduino/resources/checksums.go:72 +#: arduino/resources/install.go:59 +msgid "opening archive file: %s" +msgstr "opening archive file: %s" + +#: arduino/cores/packagemanager/loader.go:272 +msgid "opening boards.txt: %s" +msgstr "opening boards.txt: %s" + +#: arduino/serialutils/serialutils.go:37 +msgid "opening port at 1200bps" +msgstr "opening port at 1200bps" + +#: arduino/security/signatures.go:81 +msgid "opening signature file: %s" +msgstr "opening signature file: %s" + +#: commands/debug/debug_info.go:52 +msgid "opening sketch" +msgstr "opening sketch" + +#: commands/board/attach.go:50 +#: commands/compile/compile.go:103 +#: commands/upload/upload.go:52 +msgid "opening sketch: %s" +msgstr "opening sketch: %s" + +#: arduino/security/signatures.go:76 +msgid "opening target file: %s" +msgstr "opening target file: %s" + +#: arduino/cores/packagemanager/download.go:73 +#: arduino/cores/status.go:88 +#: arduino/cores/status.go:113 +msgid "package %s not found" +msgstr "package %s not found" + +#: arduino/cores/packagemanager/package_manager.go:250 +msgid "package '%s' not found" +msgstr "package '%s' not found" + +#: arduino/cores/status.go:167 +msgid "package not found" +msgstr "package not found" + +#: arduino/cores/packagemanager/loader.go:226 +msgid "parsing IDE bundled index: %s" +msgstr "parsing IDE bundled index: %s" + +#: arduino/cores/board.go:139 +#: arduino/cores/packagemanager/package_manager.go:127 +#: commands/board/details.go:38 +#: commands/lib/list.go:56 +msgid "parsing fqbn: %s" +msgstr "parsing fqbn: %s" + +#: arduino/libraries/librariesindex/json.go:69 +msgid "parsing library_index.json: %s" +msgstr "parsing library_index.json: %s" + +#: commands/instances.go:468 +msgid "parsing url for index signature check: %s" +msgstr "parsing url for index signature check: %s" + +#: arduino/cores/packagemanager/loader.go:188 +msgid "path is not a platform directory: %s" +msgstr "path is not a platform directory: %s" + +#: arduino/cores/packagemanager/download.go:77 +msgid "platform %[1]s not found in package %[2]s" +msgstr "platform %[1]s not found in package %[2]s" + +#: arduino/cores/packagemanager/download.go:89 +msgid "platform %s has no available releases" +msgstr "platform %s has no available releases" + +#: arduino/cores/packagemanager/package_manager.go:173 +#: commands/core/upgrade.go:74 +#: commands/core/upgrade.go:84 +#: commands/instances.go:744 +msgid "platform %s is not installed" +msgstr "platform %s is not installed" + +#: commands/core/upgrade.go:70 +msgid "platform %s not found" +msgstr "platform %s not found" + +#: commands/core/upgrade.go:31 +msgid "platform already at latest version" +msgstr "platform already at latest version" + +#: commands/core/uninstall.go:43 +msgid "platform not found: %s" +msgstr "platform not found: %s" + +#: arduino/cores/packagemanager/install_uninstall.go:65 +#: arduino/cores/packagemanager/install_uninstall.go:108 +#: arduino/cores/packagemanager/loader.go:364 +#: commands/compile/compile.go:128 +msgid "platform not installed" +msgstr "platform not installed" + +#: commands/core/uninstall.go:48 +msgid "platform not installed: %s" +msgstr "platform not installed: %s" + +#: cli/compile/compile.go:120 +msgid "please use --build-property instead." +msgstr "please use --build-property instead." + +#: cli/board/attach.go:36 +msgid "port" +msgstr "port" + +#: commands/upload/upload.go:155 +msgid "programmer '%s' not available" +msgstr "programmer '%s' not available" + +#: commands/debug/debug_info.go:114 +msgid "programmer '%s' not found" +msgstr "programmer '%s' not found" + +#: commands/upload/upload.go:83 +msgid "programmer not specified" +msgstr "programmer not specified" + +#: commands/upload/upload.go:380 +msgid "programming error: %s" +msgstr "programming error: %s" + +#: arduino/discovery/discovery.go:231 +msgid "protocol version not supported: requested 1, got %d" +msgstr "protocol version not supported: requested 1, got %d" + +#: arduino/cores/packagemanager/loader.go:77 +msgid "reading %[1]s directory: %[2]s" +msgstr "reading %[1]s directory: %[2]s" + +#: arduino/cores/packagemanager/loader.go:569 +msgid "reading %[1]s: %[2]s" +msgstr "reading %[1]s: %[2]s" + +#: commands/compile/compile.go:263 +msgid "reading build directory: %s" +msgstr "reading build directory: %s" + +#: arduino/cores/packagemanager/loader.go:266 +#: arduino/libraries/librariesmanager/librariesmanager.go:196 +msgid "reading dir %[1]s: %[2]s" +msgstr "reading dir %[1]s: %[2]s" + +#: arduino/cores/packagemanager/loader.go:161 +#: arduino/cores/packagemanager/loader.go:477 +msgid "reading directory %[1]s: %[2]s" +msgstr "reading directory %[1]s: %[2]s" + +#: arduino/builder/sketch.go:76 +msgid "reading file %[1]s: %[2]s" +msgstr "reading file %[1]s: %[2]s" + +#: arduino/sketch/sketch.go:228 +msgid "reading files: %v" +msgstr "reading files: %v" + +#: inventory/inventory.go:57 +msgid "reading inventory file: %w" +msgstr "reading inventory file: %w" + +#: arduino/libraries/librariesresolver/cpp.go:60 +msgid "reading lib headers: %s" +msgstr "reading lib headers: %s" + +#: arduino/libraries/libraries.go:234 +msgid "reading lib src dir: %s" +msgstr "reading lib src dir: %s" + +#: arduino/libraries/librariesindex/json.go:63 +msgid "reading library_index.json: %s" +msgstr "reading library_index.json: %s" + +#: arduino/resources/install.go:118 +msgid "reading package root dir: %s" +msgstr "reading package root dir: %s" + +#: arduino/sketch/sketch.go:187 +msgid "reading sketch metadata %[1]s: %[2]s" +msgstr "reading sketch metadata %[1]s: %[2]s" + +#: commands/upload/upload.go:395 +msgid "recipe not found '%s'" +msgstr "recipe not found '%s'" + +#: arduino/cores/packagemanager/package_manager.go:326 +msgid "release %[1]s not found for tool %[2]s" +msgstr "release %[1]s not found for tool %[2]s" + +#: arduino/cores/status.go:82 +#: arduino/cores/status.go:106 +msgid "release cannot be nil" +msgstr "release cannot be nil" + +#: arduino/cores/status.go:183 +msgid "release not found" +msgstr "release not found" + +#: arduino/resources/helpers.go:59 +msgid "removing corrupted archive file: %s" +msgstr "removing corrupted archive file: %s" + +#: arduino/libraries/librariesmanager/install.go:89 +msgid "removing lib directory: %s" +msgstr "removing lib directory: %s" + +#: arduino/cores/packagemanager/install_uninstall.go:117 +msgid "removing platform files: %s" +msgstr "removing platform files: %s" + +#: arduino/cores/packagemanager/install_uninstall.go:169 +msgid "removing tool files: %s" +msgstr "removing tool files: %s" + +#: arduino/cores/packagemanager/download.go:84 +msgid "required version %[1]s not found for platform %[2]s" +msgstr "required version %[1]s not found for platform %[2]s" + +#: commands/lib/install.go:82 +#: commands/lib/upgrade.go:38 +msgid "rescanning libraries: %s" +msgstr "rescanning libraries: %s" + +#: arduino/security/signatures.go:72 +msgid "retrieving Arduino public keys: %s" +msgstr "retrieving Arduino public keys: %s" + +#: commands/upload/upload.go:283 +msgid "retrieving build artifacts: %s" +msgstr "retrieving build artifacts: %s" + +#: commands/instances.go:510 +msgid "saving downloaded index %[1]s: %[2]s" +msgstr "saving downloaded index %[1]s: %[2]s" + +#: commands/instances.go:514 +msgid "saving downloaded index signature: %s" +msgstr "saving downloaded index signature: %s" + +#: arduino/libraries/loader.go:109 +#: arduino/libraries/loader.go:140 +msgid "scanning examples: %s" +msgstr "scanning examples: %s" + +#: arduino/cores/packagemanager/loader.go:555 +msgid "searching for builtin_tools_versions.txt in %[1]s: %[2]s" +msgstr "searching for builtin_tools_versions.txt in %[1]s: %[2]s" + +#: arduino/resources/install.go:73 +msgid "searching package root dir: %s" +msgstr "searching package root dir: %s" + +#: arduino/serialutils/serialutils.go:43 +msgid "setting DTR to OFF" +msgstr "setting DTR to OFF" + +#: commands/instances.go:494 +msgid "signature verification error: %s" +msgstr "signature verification error: %s" + +#: cli/board/attach.go:36 +#: cli/sketch/archive.go:38 +msgid "sketchPath" +msgstr "sketchPath" + +#: arduino/cores/packagemanager/loader.go:427 +msgid "skipping loading of boards %s: malformed custom board options" +msgstr "skipping loading of boards %s: malformed custom board options" + +#: legacy/builder/utils/utils.go:463 +msgid "source is not a directory" +msgstr "source is not a directory" + +#: commands/bundled_tools_serial_discovery.go:129 +#: commands/bundled_tools_serial_discovery.go:133 +#: commands/bundled_tools_serial_discovery.go:157 +#: commands/bundled_tools_serial_discovery.go:161 +msgid "starting discovery: %v" +msgstr "starting discovery: %v" + +#: commands/bundled_tools_serial_discovery.go:165 +msgid "starting sync: %v" +msgstr "starting sync: %v" + +#: arduino/resources/checksums.go:119 +msgid "testing archive checksum: %s" +msgstr "testing archive checksum: %s" + +#: arduino/resources/checksums.go:112 +msgid "testing archive size: %s" +msgstr "testing archive size: %s" + +#: arduino/resources/checksums.go:106 +msgid "testing if archive is cached: %s" +msgstr "testing if archive is cached: %s" + +#: arduino/resources/install.go:37 +msgid "testing local archive integrity: %s" +msgstr "testing local archive integrity: %s" + +#: legacy/builder/phases/sizer.go:111 +msgid "text section exceeds available space in board" +msgstr "text section exceeds available space in board" + +#: arduino/libraries/librariesmanager/librariesmanager.go:65 +msgid "the library name is different from the set (%[1]s != %[2]s)" +msgstr "the library name is different from the set (%[1]s != %[2]s)" + +#: commands/board/list.go:73 +msgid "the server responded with status %s" +msgstr "the server responded with status %s" + +#: cli/core/download.go:40 +msgid "to download the latest version of Arduino SAMD core.\n" +"" +msgstr "to download the latest version of Arduino SAMD core.\n" +"" + +#: arduino/cores/packagemanager/install_uninstall.go:165 +msgid "tool %s is not managed by package manager" +msgstr "tool %s is not managed by package manager" + +#: commands/core/download.go:84 +msgid "tool %s not available for the current OS" +msgstr "tool %s not available for the current OS" + +#: arduino/cores/status.go:92 +#: arduino/cores/status.go:117 +msgid "tool %s not found" +msgstr "tool %s not found" + +#: arduino/cores/packagemanager/package_manager.go:276 +msgid "tool '%[1]s' not found in package '%[2]s'" +msgstr "tool '%[1]s' not found in package '%[2]s'" + +#: arduino/cores/packagemanager/download.go:114 +msgid "tool not available for your OS" +msgstr "tool not available for your OS" + +#: arduino/cores/status.go:171 +msgid "tool not found" +msgstr "tool not found" + +#: arduino/cores/packagemanager/install_uninstall.go:160 +msgid "tool not installed" +msgstr "tool not installed" + +#: arduino/cores/packagemanager/package_manager.go:477 +msgid "tool release not found: %s" +msgstr "tool release not found: %s" + +#: arduino/cores/status.go:96 +msgid "tool version %s not found" +msgstr "tool version %s not found" + +#: commands/lib/install.go:54 +msgid "two different versions of the library %[1]s are required: %[2]s and %[3]s" +msgstr "two different versions of the library %[1]s are required: %[2]s and %[3]s" + +#: arduino/builder/sketch.go:69 +#: arduino/builder/sketch.go:117 +msgid "unable to compute relative path to the sketch for the item" +msgstr "unable to compute relative path to the sketch for the item" + +#: arduino/builder/sketch.go:49 +msgid "unable to create a folder to save the sketch" +msgstr "unable to create a folder to save the sketch" + +#: arduino/builder/sketch.go:111 +msgid "unable to create a folder to save the sketch files" +msgstr "unable to create a folder to save the sketch files" + +#: arduino/builder/sketch.go:123 +msgid "unable to create the folder containing the item" +msgstr "unable to create the folder containing the item" + +#: commands/core/list.go:33 +msgid "unable to find an instance with ID: %d" +msgstr "unable to find an instance with ID: %d" + +#: cli/config/dump.go:53 +msgid "unable to marshal config to YAML: %v" +msgstr "unable to marshal config to YAML: %v" + +#: arduino/builder/sketch.go:161 +msgid "unable to read contents of the destination item" +msgstr "unable to read contents of the destination item" + +#: arduino/builder/sketch.go:134 +msgid "unable to read contents of the source item" +msgstr "unable to read contents of the source item" + +#: arduino/builder/sketch.go:55 +msgid "unable to save the sketch on disk" +msgstr "unable to save the sketch on disk" + +#: arduino/builder/sketch.go:144 +msgid "unable to write to destination file" +msgstr "unable to write to destination file" + +#: arduino/cores/packagemanager/package_manager.go:161 +msgid "unknown package %s" +msgstr "unknown package %s" + +#: arduino/cores/packagemanager/package_manager.go:168 +msgid "unknown platform %s:%s" +msgstr "unknown platform %s:%s" + +#: arduino/sketch/sketch.go:141 +msgid "unknown sketch file extension '%s'" +msgstr "unknown sketch file extension '%s'" + +#: commands/debug/debug.go:173 +msgid "unsupported gdb server '%s'" +msgstr "unsupported gdb server '%s'" + +#: arduino/resources/checksums.go:62 +msgid "unsupported hash algorithm: %s" +msgstr "unsupported hash algorithm: %s" + +#: commands/debug/debug.go:134 +msgid "unsupported toolchain '%s'" +msgstr "unsupported toolchain '%s'" + +#: commands/instances.go:378 +msgid "unzipping library_index.json.gz" +msgstr "unzipping library_index.json.gz" + +#: cli/core/upgrade.go:42 +msgid "upgrade arduino:samd to the latest version" +msgstr "upgrade arduino:samd to the latest version" + +#: commands/core/upgrade.go:64 +msgid "upgrade doesn't accept parameters with version" +msgstr "upgrade doesn't accept parameters with version" + +#: cli/core/upgrade.go:40 +msgid "upgrade everything to the latest version" +msgstr "upgrade everything to the latest version" + +#: commands/core/install.go:156 +msgid "upgrading platform: %s" +msgstr "upgrading platform: %s" + +#: commands/upload/upload.go:384 +#: commands/upload/upload.go:430 +msgid "uploading error: %s" +msgstr "uploading error: %s" + +#: commands/instances.go:383 +msgid "verifying signature" +msgstr "verifying signature" + +#: commands/instances.go:392 +msgid "writing library_index.json" +msgstr "writing library_index.json" + +#: commands/instances.go:395 +msgid "writing library_index.json.sig" +msgstr "writing library_index.json.sig" + +#: arduino/sketch/sketch.go:211 +msgid "writing sketch metadata %[1]s: %[2]s" +msgstr "writing sketch metadata %[1]s: %[2]s" + +#: commands/board/list.go:89 +msgid "wrong format in server response" +msgstr "wrong format in server response" + +#: legacy/builder/constants/constants.go:100 +msgid "{0} invalid" +msgstr "{0} invalid" + +#: legacy/builder/constants/constants.go:102 +msgid "{0} is not a valid fully qualified board name. Required format is targetPackageName:targetPlatformName:targetBoardName." +msgstr "{0} is not a valid fully qualified board name. Required format is targetPackageName:targetPlatformName:targetBoardName." + +#: legacy/builder/builder_utils/utils.go:323 +#: legacy/builder/builder_utils/utils.go:329 +#: legacy/builder/builder_utils/utils.go:393 +msgid "{0} newer than {1}" +msgstr "{0} newer than {1}" + +#: legacy/builder/constants/constants.go:114 +msgid "{0}: Unknown package" +msgstr "{0}: Unknown package" diff --git a/i18n/rice-box.go b/i18n/rice-box.go index 863bd9af41a..c74c7c117ac 100644 --- a/i18n/rice-box.go +++ b/i18n/rice-box.go @@ -12,25 +12,25 @@ func init() { // define files file2 := &embedded.EmbeddedFile{ Filename: ".gitkeep", - FileModTime: time.Unix(1615910215, 0), + FileModTime: time.Unix(1614542000, 0), Content: string(""), } file3 := &embedded.EmbeddedFile{ Filename: "en.po", - FileModTime: time.Unix(1624456434, 0), + FileModTime: time.Unix(1628164297, 0), - Content: string("msgid \"\"\nmsgstr \"\"\n\n#: cli/usage.go:31\nmsgid \"Additional help topics:\"\nmsgstr \"Additional help topics:\"\n\n#: cli/usage.go:26\nmsgid \"Aliases:\"\nmsgstr \"Aliases:\"\n\n#: cli/usage.go:28\nmsgid \"Available Commands:\"\nmsgstr \"Available Commands:\"\n\n#: cli/board/details.go:120\nmsgid \"Board name:\"\nmsgstr \"Board name:\"\n\n#: cli/board/details.go:122\nmsgid \"Board version:\"\nmsgstr \"Board version:\"\n\n#: cli/board/details.go:168\nmsgid \"Checksum:\"\nmsgstr \"Checksum:\"\n\n#: cli/board/details.go:124\nmsgid \"Debugging supported:\"\nmsgstr \"Debugging supported:\"\n\n#: cli/board/details.go:71\nmsgid \"Error getting board details: %v\"\nmsgstr \"Error getting board details: %v\"\n\n#: cli/usage.go:27\nmsgid \"Examples:\"\nmsgstr \"Examples:\"\n\n#: cli/board/details.go:166\nmsgid \"File:\"\nmsgstr \"File:\"\n\n#: cli/usage.go:29\nmsgid \"Flags:\"\nmsgstr \"Flags:\"\n\n#: cli/usage.go:30\nmsgid \"Global Flags:\"\nmsgstr \"Global Flags:\"\n\n#: cli/board/details.go:93\n#: cli/board/details.go:194\nmsgid \"Id\"\nmsgstr \"Id\"\n\n#: cli/board/details.go:135\nmsgid \"Identification properties:\"\nmsgstr \"Identification properties:\"\n\n#: cli/board/details.go:194\nmsgid \"Name\"\nmsgstr \"Name\"\n\n#: cli/board/details.go:165\nmsgid \"OS:\"\nmsgstr \"OS:\"\n\n#: cli/board/details.go:129\nmsgid \"Official Arduino board:\"\nmsgstr \"Official Arduino board:\"\n\n#: cli/board/details.go:177\nmsgid \"Option:\"\nmsgstr \"Option:\"\n\n#: cli/board/details.go:145\nmsgid \"Package URL:\"\nmsgstr \"Package URL:\"\n\n#: cli/board/details.go:144\nmsgid \"Package maintainer:\"\nmsgstr \"Package maintainer:\"\n\n#: cli/board/details.go:143\nmsgid \"Package name:\"\nmsgstr \"Package name:\"\n\n#: cli/board/details.go:147\nmsgid \"Package online help:\"\nmsgstr \"Package online help:\"\n\n#: cli/board/details.go:146\nmsgid \"Package website:\"\nmsgstr \"Package website:\"\n\n#: cli/board/details.go:153\nmsgid \"Platform URL:\"\nmsgstr \"Platform URL:\"\n\n#: cli/board/details.go:152\nmsgid \"Platform architecture:\"\nmsgstr \"Platform architecture:\"\n\n#: cli/board/details.go:151\nmsgid \"Platform category:\"\nmsgstr \"Platform category:\"\n\n#: cli/board/details.go:158\nmsgid \"Platform checksum:\"\nmsgstr \"Platform checksum:\"\n\n#: cli/board/details.go:154\nmsgid \"Platform file name:\"\nmsgstr \"Platform file name:\"\n\n#: cli/board/details.go:150\nmsgid \"Platform name:\"\nmsgstr \"Platform name:\"\n\n#: cli/board/details.go:156\nmsgid \"Platform size (bytes):\"\nmsgstr \"Platform size (bytes):\"\n\n#: cli/board/details.go:42\nmsgid \"Print details about a board.\"\nmsgstr \"Print details about a board.\"\n\n#: cli/board/details.go:93\nmsgid \"Programmer name\"\nmsgstr \"Programmer name\"\n\n#: cli/board/details.go:194\nmsgid \"Programmers:\"\nmsgstr \"Programmers:\"\n\n#: cli/board/details.go:162\nmsgid \"Required tool:\"\nmsgstr \"Required tool:\"\n\n#: cli/board/details.go:49\nmsgid \"Show full board details\"\nmsgstr \"Show full board details\"\n\n#: cli/board/details.go:43\nmsgid \"Show information about a board, in particular if the board has options to be specified in the FQBN.\"\nmsgstr \"Show information about a board, in particular if the board has options to be specified in the FQBN.\"\n\n#: cli/board/details.go:51\nmsgid \"Show list of available programmers\"\nmsgstr \"Show list of available programmers\"\n\n#: cli/board/details.go:167\nmsgid \"Size (bytes):\"\nmsgstr \"Size (bytes):\"\n\n#: cli/usage.go:25\nmsgid \"Usage:\"\nmsgstr \"Usage:\"\n\n#: cli/usage.go:32\nmsgid \"Use %s for more information about a command.\"\nmsgstr \"Use %s for more information about a command.\"\n\n"), + Content: string("msgid \"\"\nmsgstr \"\"\n\n#: legacy/builder/resolve_library.go:36\nmsgid \" -> candidates: %s\"\nmsgstr \" -> candidates: %s\"\n\n#: legacy/builder/constants/constants.go:107\nmsgid \" Not used: {0}\"\nmsgstr \" Not used: {0}\"\n\n#: legacy/builder/constants/constants.go:108\nmsgid \" Used: {0}\"\nmsgstr \" Used: {0}\"\n\n#: version/version.go:54\nmsgid \"%[1]s %[2]s Version: %[3]s Commit: %[4]s Date: %[5]s\"\nmsgstr \"%[1]s %[2]s Version: %[3]s Commit: %[4]s Date: %[5]s\"\n\n#: legacy/builder/constants/constants.go:92\nmsgid \"%[1]s folder is no longer supported! See %[2]s for more information\"\nmsgstr \"%[1]s folder is no longer supported! See %[2]s for more information\"\n\n#: cli/output/rpc_progress.go:64\nmsgid \"%s already downloaded\"\nmsgstr \"%s already downloaded\"\n\n#: commands/upload/upload.go:452\nmsgid \"%s and %s cannot be used together\"\nmsgstr \"%s and %s cannot be used together\"\n\n#: cli/debug/debug.go:165\nmsgid \"%s custom configurations\"\nmsgstr \"%s custom configurations\"\n\n#: cli/output/rpc_progress.go:76\nmsgid \"%s downloaded\"\nmsgstr \"%s downloaded\"\n\n#: commands/bundled_tools.go:57\n#: commands/core/install.go:181\nmsgid \"%s installed\"\nmsgstr \"%s installed\"\n\n#: cli/lib/check_deps.go:93\nmsgid \"%s is already installed.\"\nmsgstr \"%s is already installed.\"\n\n#: arduino/cores/packagemanager/loader.go:70\nmsgid \"%s is not a directory\"\nmsgstr \"%s is not a directory\"\n\n#: arduino/cores/packagemanager/install_uninstall.go:113\nmsgid \"%s is not managed by package manager\"\nmsgstr \"%s is not managed by package manager\"\n\n#: cli/lib/check_deps.go:96\nmsgid \"%s is required but %s is currently installed.\"\nmsgstr \"%s is required but %s is currently installed.\"\n\n#: cli/lib/check_deps.go:90\nmsgid \"%s must be installed.\"\nmsgstr \"%s must be installed.\"\n\n#: legacy/builder/builder_utils/utils.go:530\n#: legacy/builder/ctags_runner.go:41\nmsgid \"%s pattern is missing\"\nmsgstr \"%s pattern is missing\"\n\n#: commands/core/uninstall.go:90\n#: commands/core/uninstall.go:106\n#: commands/instances.go:821\nmsgid \"%s uninstalled\"\nmsgstr \"%s uninstalled\"\n\n#: cli/board/listall.go:88\n#: cli/board/search.go:90\nmsgid \"(hidden)\"\nmsgstr \"(hidden)\"\n\n#: legacy/builder/constants/constants.go:105\nmsgid \"(legacy)\"\nmsgstr \"(legacy)\"\n\n#: legacy/builder/constants/constants.go:98\nmsgid \", rebuilding all\"\nmsgstr \", rebuilding all\"\n\n#: cli/lib/install.go:71\nmsgid \"--git-url and --zip-path are disabled by default, for more information see: %v\"\nmsgstr \"--git-url and --zip-path are disabled by default, for more information see: %v\"\n\n#: cli/lib/install.go:74\nmsgid \"--git-url and --zip-path flags allow installing untrusted files, use it at your own risk.\"\nmsgstr \"--git-url and --zip-path flags allow installing untrusted files, use it at your own risk.\"\n\n#: cli/core/download.go:36\n#: cli/core/install.go:37\n#: cli/core/uninstall.go:36\n#: cli/core/upgrade.go:36\nmsgid \"ARCH\"\nmsgstr \"ARCH\"\n\n#: cli/generatedocs/generatedocs.go:79\nmsgid \"ARDUINO COMMAND LINE MANUAL\"\nmsgstr \"ARDUINO COMMAND LINE MANUAL\"\n\n#: cli/usage.go:31\nmsgid \"Additional help topics:\"\nmsgstr \"Additional help topics:\"\n\n#: cli/config/add.go:31\n#: cli/config/add.go:32\nmsgid \"Adds one or more values to a setting.\"\nmsgstr \"Adds one or more values to a setting.\"\n\n#: cli/usage.go:26\nmsgid \"Aliases:\"\nmsgstr \"Aliases:\"\n\n#: cli/core/upgrade.go:66\nmsgid \"All the cores are already at the latest version\"\nmsgstr \"All the cores are already at the latest version\"\n\n#: commands/instances.go:693\n#: commands/lib/install.go:92\nmsgid \"Already installed %s\"\nmsgstr \"Already installed %s\"\n\n#: legacy/builder/resolve_library.go:34\nmsgid \"Alternatives for %[1]s: %[2]s\"\nmsgstr \"Alternatives for %[1]s: %[2]s\"\n\n#: cli/lib/search.go:170\nmsgid \"Architecture: %s\"\nmsgstr \"Architecture: %s\"\n\n#: legacy/builder/constants/constants.go:93\nmsgid \"Archiving built core (caching) in: {0}\"\nmsgstr \"Archiving built core (caching) in: {0}\"\n\n#: cli/sketch/sketch.go:31\n#: cli/sketch/sketch.go:32\nmsgid \"Arduino CLI sketch commands.\"\nmsgstr \"Arduino CLI sketch commands.\"\n\n#: cli/cli.go:67\nmsgid \"Arduino CLI.\"\nmsgstr \"Arduino CLI.\"\n\n#: cli/cli.go:68\nmsgid \"Arduino Command Line Interface (arduino-cli).\"\nmsgstr \"Arduino Command Line Interface (arduino-cli).\"\n\n#: cli/board/board.go:28\n#: cli/board/board.go:29\nmsgid \"Arduino board commands.\"\nmsgstr \"Arduino board commands.\"\n\n#: cli/cache/cache.go:31\n#: cli/cache/cache.go:32\nmsgid \"Arduino cache commands.\"\nmsgstr \"Arduino cache commands.\"\n\n#: cli/lib/lib.go:31\n#: cli/lib/lib.go:32\nmsgid \"Arduino commands about libraries.\"\nmsgstr \"Arduino commands about libraries.\"\n\n#: cli/config/config.go:31\nmsgid \"Arduino configuration commands.\"\nmsgstr \"Arduino configuration commands.\"\n\n#: cli/core/core.go:31\n#: cli/core/core.go:32\nmsgid \"Arduino core operations.\"\nmsgstr \"Arduino core operations.\"\n\n#: cli/lib/check_deps.go:50\n#: cli/lib/install.go:117\nmsgid \"Arguments error: %v\"\nmsgstr \"Arguments error: %v\"\n\n#: cli/board/attach.go:70\nmsgid \"Attach board error: %v\"\nmsgstr \"Attach board error: %v\"\n\n#: cli/board/attach.go:37\n#: cli/board/attach.go:38\n#: cli/board/board.go:32\nmsgid \"Attaches a sketch to a board.\"\nmsgstr \"Attaches a sketch to a board.\"\n\n#: cli/lib/search.go:161\nmsgid \"Author: %s\"\nmsgstr \"Author: %s\"\n\n#: cli/lib/list.go:125\nmsgid \"Available\"\nmsgstr \"Available\"\n\n#: cli/usage.go:28\nmsgid \"Available Commands:\"\nmsgstr \"Available Commands:\"\n\n#: cli/upload/upload.go:62\nmsgid \"Binary file to upload.\"\nmsgstr \"Binary file to upload.\"\n\n#: cli/board/list.go:92\n#: cli/board/list.go:131\n#: cli/board/listall.go:84\n#: cli/board/search.go:86\nmsgid \"Board Name\"\nmsgstr \"Board Name\"\n\n#: commands/board/attach.go:94\nmsgid \"Board found: %s\"\nmsgstr \"Board found: %s\"\n\n#: cli/board/details.go:120\nmsgid \"Board name:\"\nmsgstr \"Board name:\"\n\n#: cli/board/details.go:122\nmsgid \"Board version:\"\nmsgstr \"Board version:\"\n\n#: legacy/builder/constants/constants.go:96\nmsgid \"Board {0} (platform {1}, package {2}) is unknown\"\nmsgstr \"Board {0} (platform {1}, package {2}) is unknown\"\n\n#: legacy/builder/constants/constants.go:97\nmsgid \"Bootloader file specified but missing: {0}\"\nmsgstr \"Bootloader file specified but missing: {0}\"\n\n#: legacy/builder/constants/constants.go:99\nmsgid \"Build options changed\"\nmsgstr \"Build options changed\"\n\n#: cli/compile/compile.go:87\nmsgid \"Builds of 'core.a' are saved into this path to be cached and reused.\"\nmsgstr \"Builds of 'core.a' are saved into this path to be cached and reused.\"\n\n#: cli/config/set.go:54\nmsgid \"Can't set multiple values in key %v\"\nmsgstr \"Can't set multiple values in key %v\"\n\n#: cli/config/init.go:60\nmsgid \"Can't use both --dest-file and --dest-dir flags at the same time.\"\nmsgstr \"Can't use both --dest-file and --dest-dir flags at the same time.\"\n\n#: cli/config/add.go:60\n#: cli/config/delete.go:67\n#: cli/config/remove.go:69\nmsgid \"Can't write config file: %v\"\nmsgstr \"Can't write config file: %v\"\n\n#: cli/config/init.go:97\nmsgid \"Cannot create config file directory: %v\"\nmsgstr \"Cannot create config file directory: %v\"\n\n#: cli/config/init.go:106\nmsgid \"Cannot create config file: %v\"\nmsgstr \"Cannot create config file: %v\"\n\n#: commands/debug/debug.go:67\nmsgid \"Cannot execute debug tool\"\nmsgstr \"Cannot execute debug tool\"\n\n#: cli/config/init.go:72\n#: cli/config/init.go:83\nmsgid \"Cannot find absolute path: %v\"\nmsgstr \"Cannot find absolute path: %v\"\n\n#: commands/debug/debug.go:51\nmsgid \"Cannot get command line for tool\"\nmsgstr \"Cannot get command line for tool\"\n\n#: configuration/configuration.go:147\n#: configuration/configuration.go:153\nmsgid \"Cannot get executable path: %v\"\nmsgstr \"Cannot get executable path: %v\"\n\n#: commands/upload/upload.go:351\nmsgid \"Cannot perform port reset: %s\"\nmsgstr \"Cannot perform port reset: %s\"\n\n#: cli/lib/search.go:169\nmsgid \"Category: %s\"\nmsgstr \"Category: %s\"\n\n#: cli/lib/check_deps.go:35\n#: cli/lib/check_deps.go:36\nmsgid \"Check dependencies status for the specified library.\"\nmsgstr \"Check dependencies status for the specified library.\"\n\n#: legacy/builder/builder_utils/utils.go:280\nmsgid \"Checking previous results for {0} (result = {1}, dep = {2})\"\nmsgstr \"Checking previous results for {0} (result = {1}, dep = {2})\"\n\n#: arduino/resources/checksums.go:182\nmsgid \"Checksum differs from checksum in package.json\"\nmsgstr \"Checksum differs from checksum in package.json\"\n\n#: cli/board/details.go:168\nmsgid \"Checksum:\"\nmsgstr \"Checksum:\"\n\n#: cli/cache/cache.go:33\nmsgid \"Clean caches.\"\nmsgstr \"Clean caches.\"\n\n#: cli/cli.go:106\nmsgid \"Comma-separated list of additional URLs for the Boards Manager.\"\nmsgstr \"Comma-separated list of additional URLs for the Boards Manager.\"\n\n#: cli/board/list.go:47\nmsgid \"Command keeps running and prints list of connected boards whenever there is a change.\"\nmsgstr \"Command keeps running and prints list of connected boards whenever there is a change.\"\n\n#: cli/compile/compile.go:73\n#: cli/compile/compile.go:74\nmsgid \"Compiles Arduino sketches.\"\nmsgstr \"Compiles Arduino sketches.\"\n\n#: legacy/builder/builder.go:81\nmsgid \"Compiling core...\"\nmsgstr \"Compiling core...\"\n\n#: legacy/builder/builder.go:75\nmsgid \"Compiling libraries...\"\nmsgstr \"Compiling libraries...\"\n\n#: legacy/builder/phases/libraries_builder.go:135\nmsgid \"Compiling library \\\"{0}\\\"\"\nmsgstr \"Compiling library \\\"{0}\\\"\"\n\n#: legacy/builder/builder.go:70\nmsgid \"Compiling sketch...\"\nmsgstr \"Compiling sketch...\"\n\n#: cli/config/init.go:90\nmsgid \"Config file already exists, use --overwrite to discard the existing one.\"\nmsgstr \"Config file already exists, use --overwrite to discard the existing one.\"\n\n#: cli/config/init.go:110\nmsgid \"Config file written to: %s\"\nmsgstr \"Config file written to: %s\"\n\n#: commands/core/install.go:171\n#: commands/instances.go:828\nmsgid \"Configuring platform\"\nmsgstr \"Configuring platform\"\n\n#: cli/board/list.go:188\nmsgid \"Connected\"\nmsgstr \"Connected\"\n\n#: cli/board/list.go:92\n#: cli/board/list.go:131\nmsgid \"Core\"\nmsgstr \"Core\"\n\n#: cli/outdated/outdated.go:62\n#: cli/update/update.go:99\nmsgid \"Core name\"\nmsgstr \"Core name\"\n\n#: cli/sketch/new.go:58\nmsgid \"Could not create sketch directory: %v\"\nmsgstr \"Could not create sketch directory: %v\"\n\n#: legacy/builder/phases/core_builder.go:48\nmsgid \"Couldn't deeply cache core build: {0}\"\nmsgstr \"Couldn't deeply cache core build: {0}\"\n\n#: legacy/builder/constants/constants.go:127\nmsgid \"Couldn't determine program size\"\nmsgstr \"Couldn't determine program size\"\n\n#: cli/board/attach.go:83\n#: cli/compile/compile.go:238\n#: cli/debug/debug.go:127\n#: cli/lib/install.go:97\n#: cli/upload/upload.go:120\nmsgid \"Couldn't get current working directory: %v\"\nmsgstr \"Couldn't get current working directory: %v\"\n\n#: cli/sketch/new.go:32\n#: cli/sketch/new.go:33\nmsgid \"Create a new Sketch\"\nmsgstr \"Create a new Sketch\"\n\n#: cli/sketch/archive.go:39\n#: cli/sketch/archive.go:40\nmsgid \"Creates a zip file containing all sketch files.\"\nmsgstr \"Creates a zip file containing all sketch files.\"\n\n#: cli/config/init.go:43\nmsgid \"Creates or updates the configuration file in the data directory or custom directory with the current configuration settings.\"\nmsgstr \"Creates or updates the configuration file in the data directory or custom directory with the current configuration settings.\"\n\n#: cli/debug/debug.go:56\nmsgid \"Debug Arduino sketches.\"\nmsgstr \"Debug Arduino sketches.\"\n\n#: cli/debug/debug.go:57\nmsgid \"Debug Arduino sketches. (this command opens an interactive gdb session)\"\nmsgstr \"Debug Arduino sketches. (this command opens an interactive gdb session)\"\n\n#: cli/debug/debug.go:66\nmsgid \"Debug interpreter e.g.: %s, %s, %s, %s, %s\"\nmsgstr \"Debug interpreter e.g.: %s, %s, %s, %s, %s\"\n\n#: cli/debug/debug.go:64\nmsgid \"Debug port, e.g.: COM10 or /dev/ttyACM0\"\nmsgstr \"Debug port, e.g.: COM10 or /dev/ttyACM0\"\n\n#: cli/board/details.go:124\nmsgid \"Debugging supported:\"\nmsgstr \"Debugging supported:\"\n\n#: cli/cache/clean.go:31\nmsgid \"Delete Boards/Library Manager download cache.\"\nmsgstr \"Delete Boards/Library Manager download cache.\"\n\n#: cli/cache/clean.go:32\nmsgid \"Delete contents of the `directories.downloads` folder, where archive files are staged during installation of libraries and boards platforms.\"\nmsgstr \"Delete contents of the `directories.downloads` folder, where archive files are staged during installation of libraries and boards platforms.\"\n\n#: cli/config/delete.go:32\n#: cli/config/delete.go:33\nmsgid \"Deletes a settings key and all its sub keys.\"\nmsgstr \"Deletes a settings key and all its sub keys.\"\n\n#: cli/lib/search.go:177\nmsgid \"Dependencies: %s\"\nmsgstr \"Dependencies: %s\"\n\n#: legacy/builder/builder_utils/utils.go:358\nmsgid \"Depfile is about different file: {0}\"\nmsgstr \"Depfile is about different file: {0}\"\n\n#: cli/lib/list.go:125\nmsgid \"Description\"\nmsgstr \"Description\"\n\n#: legacy/builder/builder.go:62\nmsgid \"Detecting libraries used...\"\nmsgstr \"Detecting libraries used...\"\n\n#: cli/board/list.go:38\nmsgid \"Detects and displays a list of boards connected to the current computer.\"\nmsgstr \"Detects and displays a list of boards connected to the current computer.\"\n\n#: cli/debug/debug.go:67\nmsgid \"Directory containing binaries for debug.\"\nmsgstr \"Directory containing binaries for debug.\"\n\n#: cli/upload/upload.go:61\nmsgid \"Directory containing binaries to upload.\"\nmsgstr \"Directory containing binaries to upload.\"\n\n#: cli/generatedocs/generatedocs.go:45\nmsgid \"Directory where to save generated files. Default is './docs', the directory must exist.\"\nmsgstr \"Directory where to save generated files. Default is './docs', the directory must exist.\"\n\n#: cli/completion/completion.go:44\nmsgid \"Disable completion description for shells that support it\"\nmsgstr \"Disable completion description for shells that support it\"\n\n#: cli/board/list.go:189\nmsgid \"Disconnected\"\nmsgstr \"Disconnected\"\n\n#: cli/lib/install.go:49\nmsgid \"Do not install dependencies.\"\nmsgstr \"Do not install dependencies.\"\n\n#: cli/burnbootloader/burnbootloader.go:57\n#: cli/upload/upload.go:66\nmsgid \"Do not perform the actual upload, just log out actions\"\nmsgstr \"Do not perform the actual upload, just log out actions\"\n\n#: cli/daemon/daemon.go:58\nmsgid \"Do not terminate daemon process if the parent process dies\"\nmsgstr \"Do not terminate daemon process if the parent process dies\"\n\n#: commands/instances.go:682\n#: commands/instances.go:741\n#: commands/lib/download.go:55\nmsgid \"Downloading %s\"\nmsgstr \"Downloading %s\"\n\n#: commands/instances.go:93\nmsgid \"Downloading missing tool %s\"\nmsgstr \"Downloading missing tool %s\"\n\n#: commands/core/install.go:88\nmsgid \"Downloading packages\"\nmsgstr \"Downloading packages\"\n\n#: cli/core/download.go:37\n#: cli/core/download.go:38\nmsgid \"Downloads one or more cores and corresponding tool dependencies.\"\nmsgstr \"Downloads one or more cores and corresponding tool dependencies.\"\n\n#: cli/lib/download.go:35\n#: cli/lib/download.go:36\nmsgid \"Downloads one or more libraries without installing them.\"\nmsgstr \"Downloads one or more libraries without installing them.\"\n\n#: cli/lib/install.go:51\nmsgid \"Enter a path to zip file\"\nmsgstr \"Enter a path to zip file\"\n\n#: cli/lib/install.go:50\nmsgid \"Enter git url for libraries hosted on repositories\"\nmsgstr \"Enter git url for libraries hosted on repositories\"\n\n#: commands/sketch/archive.go:106\nmsgid \"Error adding file to archive: %v\"\nmsgstr \"Error adding file to archive: %v\"\n\n#: legacy/builder/constants/constants.go:94\nmsgid \"Error archiving built core (caching) in {0}: {1}\"\nmsgstr \"Error archiving built core (caching) in {0}: {1}\"\n\n#: cli/sketch/archive.go:85\nmsgid \"Error archiving: %v\"\nmsgstr \"Error archiving: %v\"\n\n#: commands/sketch/archive.go:93\nmsgid \"Error calculating relative file path: %v\"\nmsgstr \"Error calculating relative file path: %v\"\n\n#: cli/cache/clean.go:46\nmsgid \"Error cleaning caches: %v\"\nmsgstr \"Error cleaning caches: %v\"\n\n#: commands/sketch/archive.go:81\nmsgid \"Error creating archive: %v\"\nmsgstr \"Error creating archive: %v\"\n\n#: cli/core/search.go:66\n#: cli/core/update_index.go:52\n#: cli/instance/instance.go:43\n#: cli/lib/search.go:57\n#: cli/lib/update_index.go:45\n#: cli/update/update.go:62\nmsgid \"Error creating instance: %v\"\nmsgstr \"Error creating instance: %v\"\n\n#: cli/sketch/new.go:54\n#: cli/sketch/new.go:64\nmsgid \"Error creating sketch: %v\"\nmsgstr \"Error creating sketch: %v\"\n\n#: cli/board/list.go:75\n#: cli/board/list.go:85\nmsgid \"Error detecting boards: %v\"\nmsgstr \"Error detecting boards: %v\"\n\n#: cli/core/download.go:68\n#: cli/lib/download.go:62\nmsgid \"Error downloading %[1]s: %[2]v\"\nmsgstr \"Error downloading %[1]s: %[2]v\"\n\n#: commands/instances.go:760\nmsgid \"Error downloading tool %s\"\nmsgstr \"Error downloading tool %s\"\n\n#: cli/debug/debug.go:112\nmsgid \"Error during Debug: %v\"\nmsgstr \"Error during Debug: %v\"\n\n#: cli/feedback/feedback.go:134\nmsgid \"Error during JSON encoding of the output: %v\"\nmsgstr \"Error during JSON encoding of the output: %v\"\n\n#: cli/burnbootloader/burnbootloader.go:75\n#: cli/compile/compile.go:213\n#: cli/upload/upload.go:107\nmsgid \"Error during Upload: %v\"\nmsgstr \"Error during Upload: %v\"\n\n#: cli/compile/compile.go:225\nmsgid \"Error during build: %v\"\nmsgstr \"Error during build: %v\"\n\n#: cli/core/install.go:106\nmsgid \"Error during install: %v\"\nmsgstr \"Error during install: %v\"\n\n#: cli/core/uninstall.go:68\nmsgid \"Error during uninstall: %v\"\nmsgstr \"Error during uninstall: %v\"\n\n#: cli/core/upgrade.go:101\nmsgid \"Error during upgrade: %v\"\nmsgstr \"Error during upgrade: %v\"\n\n#: cli/debug/debug.go:96\n#: cli/debug/debug.go:99\nmsgid \"Error getting Debug info: %v\"\nmsgstr \"Error getting Debug info: %v\"\n\n#: commands/sketch/archive.go:59\nmsgid \"Error getting absolute archive path %v\"\nmsgstr \"Error getting absolute archive path %v\"\n\n#: cli/board/details.go:71\nmsgid \"Error getting board details: %v\"\nmsgstr \"Error getting board details: %v\"\n\n#: arduino/builder/compilation_database.go:78\nmsgid \"Error getting current directory for compilation database: %s\"\nmsgstr \"Error getting current directory for compilation database: %s\"\n\n#: cli/lib/examples.go:69\nmsgid \"Error getting libraries info: %v\"\nmsgstr \"Error getting libraries info: %v\"\n\n#: legacy/builder/types/context.go:239\nmsgid \"Error in FQBN: %s\"\nmsgstr \"Error in FQBN: %s\"\n\n#: cli/core/search.go:81\n#: cli/instance/instance.go:47\n#: cli/lib/search.go:70\n#: cli/update/update.go:87\nmsgid \"Error initializing instance: %v\"\nmsgstr \"Error initializing instance: %v\"\n\n#: commands/instances.go:787\nmsgid \"Error installing %s\"\nmsgstr \"Error installing %s\"\n\n#: cli/lib/install.go:130\nmsgid \"Error installing %s: %v\"\nmsgstr \"Error installing %s: %v\"\n\n#: cli/lib/install.go:108\nmsgid \"Error installing Git Library: %v\"\nmsgstr \"Error installing Git Library: %v\"\n\n#: cli/lib/install.go:85\nmsgid \"Error installing Zip Library: %v\"\nmsgstr \"Error installing Zip Library: %v\"\n\n#: commands/instances.go:778\nmsgid \"Error installing tool %s\"\nmsgstr \"Error installing tool %s\"\n\n#: cli/lib/list.go:77\nmsgid \"Error listing Libraries: %v\"\nmsgstr \"Error listing Libraries: %v\"\n\n#: cli/board/listall.go:61\nmsgid \"Error listing boards: %v\"\nmsgstr \"Error listing boards: %v\"\n\n#: cli/core/list.go:61\nmsgid \"Error listing platforms: %v\"\nmsgstr \"Error listing platforms: %v\"\n\n#: cli/compile/compile.go:147\nmsgid \"Error opening source code overrides data file: %v\"\nmsgstr \"Error opening source code overrides data file: %v\"\n\n#: configuration/configuration.go:69\nmsgid \"Error reading config file: %v\"\nmsgstr \"Error reading config file: %v\"\n\n#: legacy/builder/target_board_resolver.go:33\nmsgid \"Error resolving FQBN: {0}\"\nmsgstr \"Error resolving FQBN: {0}\"\n\n#: cli/lib/check_deps.go:60\nmsgid \"Error resolving dependencies for %[1]s: %[2]s\"\nmsgstr \"Error resolving dependencies for %[1]s: %[2]s\"\n\n#: commands/lib/install.go:48\nmsgid \"Error resolving dependencies for %[1]s@%[2]s: %[3]s\"\nmsgstr \"Error resolving dependencies for %[1]s@%[2]s: %[3]s\"\n\n#: cli/core/upgrade.go:61\nmsgid \"Error retrieving core list: %v\"\nmsgstr \"Error retrieving core list: %v\"\n\n#: cli/outdated/outdated.go:57\n#: cli/update/update.go:94\nmsgid \"Error retrieving outdated cores and libraries: %v\"\nmsgstr \"Error retrieving outdated cores and libraries: %v\"\n\n#: commands/sketch/archive.go:75\nmsgid \"Error retrieving sketch files: %v\"\nmsgstr \"Error retrieving sketch files: %v\"\n\n#: commands/core/install.go:153\n#: commands/instances.go:802\nmsgid \"Error rolling-back changes: %s\"\nmsgstr \"Error rolling-back changes: %s\"\n\n#: cli/board/search.go:63\nmsgid \"Error searching boards: %v\"\nmsgstr \"Error searching boards: %v\"\n\n#: cli/lib/search.go:79\nmsgid \"Error searching for Library: %v\"\nmsgstr \"Error searching for Library: %v\"\n\n#: cli/core/search.go:93\nmsgid \"Error searching for platforms: %v\"\nmsgstr \"Error searching for platforms: %v\"\n\n#: arduino/builder/compilation_database.go:63\nmsgid \"Error serializing compilation database: %s\"\nmsgstr \"Error serializing compilation database: %s\"\n\n#: cli/lib/uninstall.go:62\nmsgid \"Error uninstalling %[1]s: %[2]v\"\nmsgstr \"Error uninstalling %[1]s: %[2]v\"\n\n#: cli/update/update.go:79\nmsgid \"Error updating core and libraries index: %v\"\nmsgstr \"Error updating core and libraries index: %v\"\n\n#: cli/core/search.go:75\n#: cli/core/update_index.go:69\nmsgid \"Error updating index: %v\"\nmsgstr \"Error updating index: %v\"\n\n#: cli/core/update_index.go:61\n#: cli/lib/update_index.go:54\n#: cli/update/update.go:71\nmsgid \"Error updating indexes: %v\"\nmsgstr \"Error updating indexes: %v\"\n\n#: cli/lib/search.go:65\n#: cli/lib/update_index.go:62\nmsgid \"Error updating library index: %v\"\nmsgstr \"Error updating library index: %v\"\n\n#: cli/lib/upgrade.go:50\n#: cli/lib/upgrade.go:56\nmsgid \"Error upgrading libraries: %v\"\nmsgstr \"Error upgrading libraries: %v\"\n\n#: commands/core/install.go:148\n#: commands/instances.go:797\nmsgid \"Error upgrading platform: %s\"\nmsgstr \"Error upgrading platform: %s\"\n\n#: cli/upgrade/upgrade.go:60\nmsgid \"Error upgrading: %v\"\nmsgstr \"Error upgrading: %v\"\n\n#: legacy/builder/constants/constants.go:104\nmsgid \"Error while detecting libraries included by {0}\"\nmsgstr \"Error while detecting libraries included by {0}\"\n\n#: legacy/builder/phases/sizer.go:135\n#: legacy/builder/phases/sizer.go:141\nmsgid \"Error while determining sketch size: %s\"\nmsgstr \"Error while determining sketch size: %s\"\n\n#: arduino/builder/compilation_database.go:66\nmsgid \"Error writing compilation database: %s\"\nmsgstr \"Error writing compilation database: %s\"\n\n#: cli/completion/completion.go:51\nmsgid \"Error: command description is not supported by %v\"\nmsgstr \"Error: command description is not supported by %v\"\n\n#: cli/compile/compile.go:154\nmsgid \"Error: invalid source code overrides data file: %v\"\nmsgstr \"Error: invalid source code overrides data file: %v\"\n\n#: cli/board/list.go:92\nmsgid \"Event\"\nmsgstr \"Event\"\n\n#: cli/lib/examples.go:118\nmsgid \"Examples for library %s\"\nmsgstr \"Examples for library %s\"\n\n#: cli/usage.go:27\nmsgid \"Examples:\"\nmsgstr \"Examples:\"\n\n#: cli/debug/debug.go:146\nmsgid \"Executable to debug\"\nmsgstr \"Executable to debug\"\n\n#: cli/board/attach.go:36\n#: cli/board/details.go:41\n#: cli/board/list.go:92\n#: cli/board/list.go:131\n#: cli/board/listall.go:84\n#: cli/board/search.go:86\nmsgid \"FQBN\"\nmsgstr \"FQBN\"\n\n#: cli/board/details.go:121\nmsgid \"FQBN:\"\nmsgstr \"FQBN:\"\n\n#: cli/daemon/daemon.go:114\nmsgid \"Failed to listen on TCP port: %[1]s. %[2]s is an invalid port.\"\nmsgstr \"Failed to listen on TCP port: %[1]s. %[2]s is an invalid port.\"\n\n#: cli/daemon/daemon.go:108\nmsgid \"Failed to listen on TCP port: %[1]s. %[2]s is unknown name.\"\nmsgstr \"Failed to listen on TCP port: %[1]s. %[2]s is unknown name.\"\n\n#: cli/daemon/daemon.go:123\nmsgid \"Failed to listen on TCP port: %[1]s. Unexpected error: %[2]v\"\nmsgstr \"Failed to listen on TCP port: %[1]s. Unexpected error: %[2]v\"\n\n#: cli/daemon/daemon.go:120\nmsgid \"Failed to listen on TCP port: %s. Address already in use.\"\nmsgstr \"Failed to listen on TCP port: %s. Address already in use.\"\n\n#: legacy/builder/builder_utils/utils.go:380\nmsgid \"Failed to read: {0}\"\nmsgstr \"Failed to read: {0}\"\n\n#: cli/board/details.go:166\nmsgid \"File:\"\nmsgstr \"File:\"\n\n#: commands/daemon/debug.go:47\nmsgid \"First message must contain debug request, not data\"\nmsgstr \"First message must contain debug request, not data\"\n\n#: cli/usage.go:29\nmsgid \"Flags:\"\nmsgstr \"Flags:\"\n\n#: cli/core/install.go:59\nmsgid \"Force run of post-install scripts (if the CLI is not running interactively).\"\nmsgstr \"Force run of post-install scripts (if the CLI is not running interactively).\"\n\n#: cli/core/install.go:60\nmsgid \"Force skip of post-install scripts (if the CLI is running interactively).\"\nmsgstr \"Force skip of post-install scripts (if the CLI is running interactively).\"\n\n#: cli/board/details.go:50\n#: cli/burnbootloader/burnbootloader.go:52\n#: cli/compile/compile.go:84\n#: cli/debug/debug.go:63\n#: cli/upload/upload.go:59\nmsgid \"Fully Qualified Board Name, e.g.: arduino:avr:uno\"\nmsgstr \"Fully Qualified Board Name, e.g.: arduino:avr:uno\"\n\n#: cli/debug/debug.go:160\nmsgid \"GDB Server path\"\nmsgstr \"GDB Server path\"\n\n#: cli/debug/debug.go:159\nmsgid \"GDB Server type\"\nmsgstr \"GDB Server type\"\n\n#: cli/generatedocs/generatedocs.go:38\n#: cli/generatedocs/generatedocs.go:39\nmsgid \"Generates bash completion and command manpages.\"\nmsgstr \"Generates bash completion and command manpages.\"\n\n#: cli/completion/completion.go:38\nmsgid \"Generates completion scripts\"\nmsgstr \"Generates completion scripts\"\n\n#: cli/completion/completion.go:39\nmsgid \"Generates completion scripts for various shells\"\nmsgstr \"Generates completion scripts for various shells\"\n\n#: legacy/builder/builder.go:67\nmsgid \"Generating function prototypes...\"\nmsgstr \"Generating function prototypes...\"\n\n#: cli/usage.go:30\nmsgid \"Global Flags:\"\nmsgstr \"Global Flags:\"\n\n#: legacy/builder/constants/constants.go:122\nmsgid \"Global variables use {0} bytes ({2}%%) of dynamic memory, leaving {3} bytes for local variables. Maximum is {1} bytes.\"\nmsgstr \"Global variables use {0} bytes ({2}%%) of dynamic memory, leaving {3} bytes for local variables. Maximum is {1} bytes.\"\n\n#: legacy/builder/constants/constants.go:123\nmsgid \"Global variables use {0} bytes of dynamic memory.\"\nmsgstr \"Global variables use {0} bytes of dynamic memory.\"\n\n#: cli/core/list.go:84\n#: cli/core/search.go:114\nmsgid \"ID\"\nmsgstr \"ID\"\n\n#: cli/board/details.go:93\n#: cli/board/details.go:194\nmsgid \"Id\"\nmsgstr \"Id\"\n\n#: cli/board/details.go:135\nmsgid \"Identification properties:\"\nmsgstr \"Identification properties:\"\n\n#: cli/compile/compile.go:114\nmsgid \"If set built binaries will be exported to the sketch folder.\"\nmsgstr \"If set built binaries will be exported to the sketch folder.\"\n\n#: cli/core/list.go:42\nmsgid \"If set return all installable and installed cores, including manually installed.\"\nmsgstr \"If set return all installable and installed cores, including manually installed.\"\n\n#: cli/lib/list.go:48\nmsgid \"Include built-in libraries (from platforms and IDE) in listing.\"\nmsgstr \"Include built-in libraries (from platforms and IDE) in listing.\"\n\n#: cli/sketch/archive.go:51\nmsgid \"Includes %s directory in the archive.\"\nmsgstr \"Includes %s directory in the archive.\"\n\n#: cli/core/list.go:84\n#: cli/lib/list.go:125\nmsgid \"Installed\"\nmsgstr \"Installed\"\n\n#: commands/instances.go:707\n#: commands/lib/install.go:108\nmsgid \"Installed %s\"\nmsgstr \"Installed %s\"\n\n#: commands/lib/install.go:118\nmsgid \"Installed Archived Library\"\nmsgstr \"Installed Archived Library\"\n\n#: commands/lib/install.go:128\nmsgid \"Installed Library from Git URL\"\nmsgstr \"Installed Library from Git URL\"\n\n#: cli/outdated/outdated.go:62\n#: cli/outdated/outdated.go:72\n#: cli/update/update.go:99\n#: cli/update/update.go:109\nmsgid \"Installed version\"\nmsgstr \"Installed version\"\n\n#: commands/bundled_tools.go:50\n#: commands/core/install.go:113\n#: commands/instances.go:690\n#: commands/lib/install.go:88\nmsgid \"Installing %s\"\nmsgstr \"Installing %s\"\n\n#: cli/core/install.go:38\n#: cli/core/install.go:39\nmsgid \"Installs one or more cores and corresponding tool dependencies.\"\nmsgstr \"Installs one or more cores and corresponding tool dependencies.\"\n\n#: cli/lib/install.go:39\n#: cli/lib/install.go:40\nmsgid \"Installs one or more specified libraries into the system.\"\nmsgstr \"Installs one or more specified libraries into the system.\"\n\n#: legacy/builder/container_find_includes.go:378\nmsgid \"Internal error in cache\"\nmsgstr \"Internal error in cache\"\n\n#: cli/cli.go:224\nmsgid \"Invalid Call : should show Help, but it is available only in TEXT mode.\"\nmsgstr \"Invalid Call : should show Help, but it is available only in TEXT mode.\"\n\n#: commands/instances.go:193\nmsgid \"Invalid additional URL: %v\"\nmsgstr \"Invalid additional URL: %v\"\n\n#: cli/core/download.go:55\n#: cli/core/install.go:92\n#: cli/core/uninstall.go:51\n#: cli/core/upgrade.go:79\n#: cli/lib/download.go:50\n#: cli/lib/uninstall.go:51\nmsgid \"Invalid argument passed: %v\"\nmsgstr \"Invalid argument passed: %v\"\n\n#: legacy/builder/phases/sizer.go:160\nmsgid \"Invalid data size regexp: %s\"\nmsgstr \"Invalid data size regexp: %s\"\n\n#: legacy/builder/phases/sizer.go:166\nmsgid \"Invalid eeprom size regexp: %s\"\nmsgstr \"Invalid eeprom size regexp: %s\"\n\n#: commands/instances.go:175\nmsgid \"Invalid instance ID\"\nmsgstr \"Invalid instance ID\"\n\n#: cli/core/upgrade.go:85\nmsgid \"Invalid item %s\"\nmsgstr \"Invalid item %s\"\n\n#: httpclient/httpclient_config.go:44\nmsgid \"Invalid network.proxy '%[1]s': %[2]s\"\nmsgstr \"Invalid network.proxy '%[1]s': %[2]s\"\n\n#: cli/cli.go:185\nmsgid \"Invalid option for --log-level: %s\"\nmsgstr \"Invalid option for --log-level: %s\"\n\n#: cli/cli.go:202\nmsgid \"Invalid output format: %s\"\nmsgstr \"Invalid output format: %s\"\n\n#: cli/core/uninstall.go:57\nmsgid \"Invalid parameter %s: version not allowed\"\nmsgstr \"Invalid parameter %s: version not allowed\"\n\n#: commands/board/list.go:52\nmsgid \"Invalid pid value: '%s'\"\nmsgstr \"Invalid pid value: '%s'\"\n\n#: legacy/builder/phases/sizer.go:150\nmsgid \"Invalid size regexp: %s\"\nmsgstr \"Invalid size regexp: %s\"\n\n#: cli/board/list.go:66\nmsgid \"Invalid timeout: %v\"\nmsgstr \"Invalid timeout: %v\"\n\n#: commands/board/list.go:49\nmsgid \"Invalid vid value: '%s'\"\nmsgstr \"Invalid vid value: '%s'\"\n\n#: cli/compile/compile.go:109\nmsgid \"Just produce the compilation database, without actually compiling.\"\nmsgstr \"Just produce the compilation database, without actually compiling.\"\n\n#: cli/lib/list.go:37\nmsgid \"LIBNAME\"\nmsgstr \"LIBNAME\"\n\n#: cli/lib/check_deps.go:34\n#: cli/lib/install.go:38\nmsgid \"LIBRARY\"\nmsgstr \"LIBRARY\"\n\n#: cli/lib/download.go:34\n#: cli/lib/examples.go:38\n#: cli/lib/search.go:39\n#: cli/lib/uninstall.go:35\nmsgid \"LIBRARY_NAME\"\nmsgstr \"LIBRARY_NAME\"\n\n#: cli/core/list.go:84\nmsgid \"Latest\"\nmsgstr \"Latest\"\n\n#: commands/lib/uninstall.go:37\nmsgid \"Library %s is not installed\"\nmsgstr \"Library %s is not installed\"\n\n#: legacy/builder/constants/constants.go:109\nmsgid \"Library can't use both '%[1]s' and '%[2]s' folders. Double check {0}\"\nmsgstr \"Library can't use both '%[1]s' and '%[2]s' folders. Double check {0}\"\n\n#: cli/outdated/outdated.go:72\n#: cli/update/update.go:109\nmsgid \"Library name\"\nmsgstr \"Library name\"\n\n#: legacy/builder/phases/libraries_builder.go:91\nmsgid \"Library {0} has been declared precompiled:\"\nmsgstr \"Library {0} has been declared precompiled:\"\n\n#: cli/lib/search.go:167\nmsgid \"License: %s\"\nmsgstr \"License: %s\"\n\n#: legacy/builder/builder.go:86\nmsgid \"Linking everything together...\"\nmsgstr \"Linking everything together...\"\n\n#: cli/board/listall.go:37\n#: cli/board/search.go:38\nmsgid \"List all boards that have the support platform installed. You can search\\n\"\n\"for a specific board if you specify the board name\"\nmsgstr \"List all boards that have the support platform installed. You can search\\n\"\n\"for a specific board if you specify the board name\"\n\n#: cli/board/listall.go:36\n#: cli/board/search.go:37\nmsgid \"List all known boards and their corresponding FQBN.\"\nmsgstr \"List all known boards and their corresponding FQBN.\"\n\n#: cli/board/list.go:37\nmsgid \"List connected boards.\"\nmsgstr \"List connected boards.\"\n\n#: cli/compile/compile.go:92\nmsgid \"List of custom build properties separated by commas. Or can be used multiple times for multiple properties.\"\nmsgstr \"List of custom build properties separated by commas. Or can be used multiple times for multiple properties.\"\n\n#: cli/compile/compile.go:106\nmsgid \"List of custom libraries dir paths separated by commas. Or can be used multiple times for multiple libraries dir paths.\"\nmsgstr \"List of custom libraries dir paths separated by commas. Or can be used multiple times for multiple libraries dir paths.\"\n\n#: cli/compile/compile.go:104\nmsgid \"List of paths to libraries root folders. Libraries set this way have top priority in case of conflicts. Can be used multiple times for different libraries.\"\nmsgstr \"List of paths to libraries root folders. Libraries set this way have top priority in case of conflicts. Can be used multiple times for different libraries.\"\n\n#: cli/lib/list.go:50\nmsgid \"List updatable libraries.\"\nmsgstr \"List updatable libraries.\"\n\n#: cli/core/list.go:41\nmsgid \"List updatable platforms.\"\nmsgstr \"List updatable platforms.\"\n\n#: cli/board/board.go:30\nmsgid \"Lists all connected boards.\"\nmsgstr \"Lists all connected boards.\"\n\n#: cli/outdated/outdated.go:38\nmsgid \"Lists cores and libraries that can be upgraded\"\nmsgstr \"Lists cores and libraries that can be upgraded\"\n\n#: commands/instances.go:207\n#: commands/instances.go:218\n#: commands/instances.go:301\nmsgid \"Loading index file: %v\"\nmsgstr \"Loading index file: %v\"\n\n#: commands/instances.go:310\nmsgid \"Loading libraries: %v\"\nmsgstr \"Loading libraries: %v\"\n\n#: cli/lib/list.go:125\nmsgid \"Location\"\nmsgstr \"Location\"\n\n#: legacy/builder/constants/constants.go:111\nmsgid \"Looking for recipes like {0}*{1}\"\nmsgstr \"Looking for recipes like {0}*{1}\"\n\n#: legacy/builder/constants/constants.go:126\nmsgid \"Low memory available, stability problems may occur.\"\nmsgstr \"Low memory available, stability problems may occur.\"\n\n#: cli/lib/search.go:162\nmsgid \"Maintainer: %s\"\nmsgstr \"Maintainer: %s\"\n\n#: cli/cli.go:101\nmsgid \"Messages with this level and above will be logged. Valid levels are: %s, %s, %s, %s, %s, %s, %s\"\nmsgstr \"Messages with this level and above will be logged. Valid levels are: %s, %s, %s, %s, %s, %s, %s\"\n\n#: legacy/builder/constants/constants.go:117\nmsgid \"Missing '{0}' from library in {1}\"\nmsgstr \"Missing '{0}' from library in {1}\"\n\n#: legacy/builder/phases/sizer.go:154\nmsgid \"Missing size regexp\"\nmsgstr \"Missing size regexp\"\n\n#: legacy/builder/constants/constants.go:106\nmsgid \"Multiple libraries were found for \\\"{0}\\\"\"\nmsgstr \"Multiple libraries were found for \\\"{0}\\\"\"\n\n#: cli/board/details.go:194\n#: cli/core/list.go:84\n#: cli/core/search.go:114\n#: cli/lib/list.go:125\nmsgid \"Name\"\nmsgstr \"Name\"\n\n#: cli/lib/search.go:141\nmsgid \"Name: \\\"%s\\\"\"\nmsgstr \"Name: \\\"%s\\\"\"\n\n#: cli/outdated/outdated.go:62\n#: cli/outdated/outdated.go:72\n#: cli/update/update.go:99\n#: cli/update/update.go:109\nmsgid \"New version\"\nmsgstr \"New version\"\n\n#: cli/board/list.go:121\nmsgid \"No boards found.\"\nmsgstr \"No boards found.\"\n\n#: legacy/builder/builder_utils/utils.go:351\nmsgid \"No colon in first line of depfile\"\nmsgstr \"No colon in first line of depfile\"\n\n#: cli/lib/examples.go:103\nmsgid \"No libraries found.\"\nmsgstr \"No libraries found.\"\n\n#: cli/lib/list.go:117\nmsgid \"No libraries installed.\"\nmsgstr \"No libraries installed.\"\n\n#: cli/lib/search.go:125\nmsgid \"No libraries matching your search.\"\nmsgstr \"No libraries matching your search.\"\n\n#: cli/lib/search.go:136\nmsgid \"No libraries matching your search.\\n\"\n\"Did you mean...\\n\"\n\"\"\nmsgstr \"No libraries matching your search.\\n\"\n\"Did you mean...\\n\"\n\"\"\n\n#: cli/core/search.go:124\nmsgid \"No platforms matching your search.\"\nmsgstr \"No platforms matching your search.\"\n\n#: cli/lib/list.go:115\nmsgid \"No updates available.\"\nmsgstr \"No updates available.\"\n\n#: commands/upload/upload.go:340\nmsgid \"No upload port found, using %s as fallback\"\nmsgstr \"No upload port found, using %s as fallback\"\n\n#: legacy/builder/constants/constants.go:125\nmsgid \"Not enough memory; see %s for tips on reducing your footprint.\"\nmsgstr \"Not enough memory; see %s for tips on reducing your footprint.\"\n\n#: legacy/builder/builder_utils/utils.go:284\nmsgid \"Not found: nil\"\nmsgstr \"Not found: nil\"\n\n#: legacy/builder/builder_utils/utils.go:300\n#: legacy/builder/builder_utils/utils.go:313\n#: legacy/builder/builder_utils/utils.go:387\nmsgid \"Not found: {0}\"\nmsgstr \"Not found: {0}\"\n\n#: cli/board/details.go:165\nmsgid \"OS:\"\nmsgstr \"OS:\"\n\n#: cli/board/details.go:129\nmsgid \"Official Arduino board:\"\nmsgstr \"Official Arduino board:\"\n\n#: cli/board/details.go:177\nmsgid \"Option:\"\nmsgstr \"Option:\"\n\n#: cli/compile/compile.go:96\nmsgid \"Optional, can be \\\"%[1]s\\\", \\\"%[2]s\\\", \\\"%[3]s\\\" and \\\"%[4]s\\\". Defaults to \\\"%[1]s\\\". Used to tell gcc which warning level to use (-W flag).\"\nmsgstr \"Optional, can be \\\"%[1]s\\\", \\\"%[2]s\\\", \\\"%[3]s\\\" and \\\"%[4]s\\\". Defaults to \\\"%[1]s\\\". Used to tell gcc which warning level to use (-W flag).\"\n\n#: cli/compile/compile.go:110\nmsgid \"Optional, cleanup the build folder and do not use any cached build.\"\nmsgstr \"Optional, cleanup the build folder and do not use any cached build.\"\n\n#: cli/compile/compile.go:107\nmsgid \"Optional, optimize compile output for debugging, rather than for release.\"\nmsgstr \"Optional, optimize compile output for debugging, rather than for release.\"\n\n#: cli/compile/compile.go:98\nmsgid \"Optional, suppresses almost every output.\"\nmsgstr \"Optional, suppresses almost every output.\"\n\n#: cli/compile/compile.go:97\n#: cli/upload/upload.go:64\nmsgid \"Optional, turns on verbose mode.\"\nmsgstr \"Optional, turns on verbose mode.\"\n\n#: cli/compile/compile.go:108\n#: cli/upload/upload.go:65\nmsgid \"Optional, use the specified programmer to upload.\"\nmsgstr \"Optional, use the specified programmer to upload.\"\n\n#: cli/compile/compile.go:115\nmsgid \"Optional. Path to a .json file that contains a set of replacements of the sketch source code.\"\nmsgstr \"Optional. Path to a .json file that contains a set of replacements of the sketch source code.\"\n\n#: commands/daemon/monitor.go:72\nmsgid \"OutputRate in Null monitor must be a float64\"\nmsgstr \"OutputRate in Null monitor must be a float64\"\n\n#: cli/compile/compile.go:94\nmsgid \"Override a build property with a custom value. Can be used multiple times for multiple properties.\"\nmsgstr \"Override a build property with a custom value. Can be used multiple times for multiple properties.\"\n\n#: cli/config/init.go:54\nmsgid \"Overwrite existing config file.\"\nmsgstr \"Overwrite existing config file.\"\n\n#: cli/core/download.go:36\n#: cli/core/install.go:37\n#: cli/core/uninstall.go:36\n#: cli/core/upgrade.go:36\nmsgid \"PACKAGER\"\nmsgstr \"PACKAGER\"\n\n#: cli/board/details.go:145\nmsgid \"Package URL:\"\nmsgstr \"Package URL:\"\n\n#: cli/board/details.go:144\nmsgid \"Package maintainer:\"\nmsgstr \"Package maintainer:\"\n\n#: cli/board/details.go:143\nmsgid \"Package name:\"\nmsgstr \"Package name:\"\n\n#: cli/board/details.go:147\nmsgid \"Package online help:\"\nmsgstr \"Package online help:\"\n\n#: cli/board/details.go:146\nmsgid \"Package website:\"\nmsgstr \"Package website:\"\n\n#: cli/lib/search.go:164\nmsgid \"Paragraph: %s\"\nmsgstr \"Paragraph: %s\"\n\n#: cli/cli.go:102\nmsgid \"Path to the file where logs will be written.\"\nmsgstr \"Path to the file where logs will be written.\"\n\n#: cli/compile/compile.go:90\nmsgid \"Path where to save compiled files. If omitted, a directory will be created in the default temporary path of your OS.\"\nmsgstr \"Path where to save compiled files. If omitted, a directory will be created in the default temporary path of your OS.\"\n\n#: commands/upload/upload.go:319\nmsgid \"Performing 1200-bps touch reset on serial port %s\"\nmsgstr \"Performing 1200-bps touch reset on serial port %s\"\n\n#: commands/core/install.go:74\nmsgid \"Platform %s already installed\"\nmsgstr \"Platform %s already installed\"\n\n#: cli/core/upgrade.go:99\nmsgid \"Platform %s is already at the latest version\"\nmsgstr \"Platform %s is already at the latest version\"\n\n#: cli/board/search.go:86\nmsgid \"Platform ID\"\nmsgstr \"Platform ID\"\n\n#: cli/board/details.go:153\nmsgid \"Platform URL:\"\nmsgstr \"Platform URL:\"\n\n#: cli/board/details.go:152\nmsgid \"Platform architecture:\"\nmsgstr \"Platform architecture:\"\n\n#: cli/board/details.go:151\nmsgid \"Platform category:\"\nmsgstr \"Platform category:\"\n\n#: cli/board/details.go:158\nmsgid \"Platform checksum:\"\nmsgstr \"Platform checksum:\"\n\n#: cli/board/details.go:154\nmsgid \"Platform file name:\"\nmsgstr \"Platform file name:\"\n\n#: cli/board/details.go:150\nmsgid \"Platform name:\"\nmsgstr \"Platform name:\"\n\n#: cli/board/details.go:156\nmsgid \"Platform size (bytes):\"\nmsgstr \"Platform size (bytes):\"\n\n#: legacy/builder/constants/constants.go:115\nmsgid \"Platform {0} (package {1}) is unknown\"\nmsgstr \"Platform {0} (package {1}) is unknown\"\n\n#: cli/board/list.go:92\n#: cli/board/list.go:131\nmsgid \"Port\"\nmsgstr \"Port\"\n\n#: legacy/builder/phases/libraries_builder.go:101\n#: legacy/builder/phases/libraries_builder.go:109\nmsgid \"Precompiled library in \\\"{0}\\\" not found\"\nmsgstr \"Precompiled library in \\\"{0}\\\" not found\"\n\n#: cli/board/details.go:42\nmsgid \"Print details about a board.\"\nmsgstr \"Print details about a board.\"\n\n#: cli/compile/compile.go:86\nmsgid \"Print preprocessed code to stdout instead of compiling.\"\nmsgstr \"Print preprocessed code to stdout instead of compiling.\"\n\n#: cli/cli.go:100\nmsgid \"Print the logs on the standard output.\"\nmsgstr \"Print the logs on the standard output.\"\n\n#: cli/config/dump.go:31\nmsgid \"Prints the current configuration\"\nmsgstr \"Prints the current configuration\"\n\n#: cli/config/dump.go:32\nmsgid \"Prints the current configuration.\"\nmsgstr \"Prints the current configuration.\"\n\n#: cli/board/details.go:93\nmsgid \"Programmer name\"\nmsgstr \"Programmer name\"\n\n#: cli/debug/debug.go:65\nmsgid \"Programmer to use for debugging\"\nmsgstr \"Programmer to use for debugging\"\n\n#: cli/board/details.go:194\nmsgid \"Programmers:\"\nmsgstr \"Programmers:\"\n\n#: legacy/builder/constants/constants.go:116\nmsgid \"Progress {0}\"\nmsgstr \"Progress {0}\"\n\n#: cli/lib/search.go:174\nmsgid \"Provides includes: %s\"\nmsgstr \"Provides includes: %s\"\n\n#: cli/config/remove.go:31\n#: cli/config/remove.go:32\nmsgid \"Removes one or more values from a setting.\"\nmsgstr \"Removes one or more values from a setting.\"\n\n#: commands/instances.go:700\n#: commands/lib/install.go:101\nmsgid \"Replacing %[1]s with %[2]s\"\nmsgstr \"Replacing %[1]s with %[2]s\"\n\n#: cli/board/details.go:162\nmsgid \"Required tool:\"\nmsgstr \"Required tool:\"\n\n#: cli/daemon/daemon.go:50\nmsgid \"Run as a daemon on port %s\"\nmsgstr \"Run as a daemon on port %s\"\n\n#: cli/daemon/daemon.go:51\nmsgid \"Running as a daemon the initialization of cores and libraries is done only once.\"\nmsgstr \"Running as a daemon the initialization of cores and libraries is done only once.\"\n\n#: legacy/builder/phases/core_builder.go:49\nmsgid \"Running normal build of the core...\"\nmsgstr \"Running normal build of the core...\"\n\n#: legacy/builder/constants/constants.go:119\nmsgid \"Running recipe: {0}\"\nmsgstr \"Running recipe: {0}\"\n\n#: cli/compile/compile.go:88\nmsgid \"Save build artifacts in this directory.\"\nmsgstr \"Save build artifacts in this directory.\"\n\n#: cli/core/search.go:50\nmsgid \"Search for a core in Boards Manager using the specified keywords.\"\nmsgstr \"Search for a core in Boards Manager using the specified keywords.\"\n\n#: cli/core/search.go:49\nmsgid \"Search for a core in Boards Manager.\"\nmsgstr \"Search for a core in Boards Manager.\"\n\n#: cli/lib/search.go:41\nmsgid \"Search for one or more libraries data (case insensitive search).\"\nmsgstr \"Search for one or more libraries data (case insensitive search).\"\n\n#: cli/lib/search.go:40\nmsgid \"Searches for one or more libraries data.\"\nmsgstr \"Searches for one or more libraries data.\"\n\n#: legacy/builder/constants/constants.go:113\nmsgid \"Selected board depends on '{0}' core (not installed).\"\nmsgstr \"Selected board depends on '{0}' core (not installed).\"\n\n#: commands/board/attach.go:109\nmsgid \"Selected fqbn: %s\"\nmsgstr \"Selected fqbn: %s\"\n\n#: cli/lib/search.go:163\nmsgid \"Sentence: %s\"\nmsgstr \"Sentence: %s\"\n\n#: cli/config/set.go:32\n#: cli/config/set.go:33\nmsgid \"Sets a setting value.\"\nmsgstr \"Sets a setting value.\"\n\n#: cli/config/init.go:52\n#: cli/config/init.go:53\nmsgid \"Sets where to save the configuration file.\"\nmsgstr \"Sets where to save the configuration file.\"\n\n#: legacy/builder/constants/constants.go:120\nmsgid \"Setting build path to {0}\"\nmsgstr \"Setting build path to {0}\"\n\n#: cli/config/delete.go:57\n#: cli/config/validate.go:43\nmsgid \"Settings key doesn't exist\"\nmsgstr \"Settings key doesn't exist\"\n\n#: cli/core/search.go:55\nmsgid \"Show all available core versions.\"\nmsgstr \"Show all available core versions.\"\n\n#: cli/compile/compile.go:85\nmsgid \"Show all build properties used instead of compiling.\"\nmsgstr \"Show all build properties used instead of compiling.\"\n\n#: cli/board/listall.go:45\n#: cli/board/search.go:46\nmsgid \"Show also boards marked as 'hidden' in the platform\"\nmsgstr \"Show also boards marked as 'hidden' in the platform\"\n\n#: cli/board/details.go:49\nmsgid \"Show full board details\"\nmsgstr \"Show full board details\"\n\n#: cli/board/details.go:43\nmsgid \"Show information about a board, in particular if the board has options to be specified in the FQBN.\"\nmsgstr \"Show information about a board, in particular if the board has options to be specified in the FQBN.\"\n\n#: cli/lib/examples.go:45\n#: cli/lib/list.go:49\nmsgid \"Show libraries for the specified board FQBN.\"\nmsgstr \"Show libraries for the specified board FQBN.\"\n\n#: cli/lib/search.go:46\nmsgid \"Show library names only.\"\nmsgstr \"Show library names only.\"\n\n#: cli/board/details.go:51\nmsgid \"Show list of available programmers\"\nmsgstr \"Show list of available programmers\"\n\n#: cli/debug/debug.go:68\nmsgid \"Show metadata about the debug session instead of starting the debugger.\"\nmsgstr \"Show metadata about the debug session instead of starting the debugger.\"\n\n#: cli/update/update.go:46\nmsgid \"Show outdated cores and libraries after index update\"\nmsgstr \"Show outdated cores and libraries after index update\"\n\n#: cli/lib/list.go:38\nmsgid \"Shows a list of installed libraries.\"\nmsgstr \"Shows a list of installed libraries.\"\n\n#: cli/lib/list.go:39\nmsgid \"Shows a list of installed libraries.\\n\"\n\"\\n\"\n\"If the LIBNAME parameter is specified the listing is limited to that specific\\n\"\n\"library. By default the libraries provided as built-in by platforms/core are\\n\"\n\"not listed, they can be listed by adding the --all flag.\"\nmsgstr \"Shows a list of installed libraries.\\n\"\n\"\\n\"\n\"If the LIBNAME parameter is specified the listing is limited to that specific\\n\"\n\"library. By default the libraries provided as built-in by platforms/core are\\n\"\n\"not listed, they can be listed by adding the --all flag.\"\n\n#: cli/core/list.go:35\n#: cli/core/list.go:36\nmsgid \"Shows the list of installed platforms.\"\nmsgstr \"Shows the list of installed platforms.\"\n\n#: cli/lib/examples.go:39\nmsgid \"Shows the list of the examples for libraries.\"\nmsgstr \"Shows the list of the examples for libraries.\"\n\n#: cli/lib/examples.go:40\nmsgid \"Shows the list of the examples for libraries. A name may be given as argument to search a specific library.\"\nmsgstr \"Shows the list of the examples for libraries. A name may be given as argument to search a specific library.\"\n\n#: cli/version/version.go:34\nmsgid \"Shows the version number of Arduino CLI which is installed on your system.\"\nmsgstr \"Shows the version number of Arduino CLI which is installed on your system.\"\n\n#: cli/version/version.go:33\nmsgid \"Shows version number of Arduino CLI.\"\nmsgstr \"Shows version number of Arduino CLI.\"\n\n#: cli/board/details.go:167\nmsgid \"Size (bytes):\"\nmsgstr \"Size (bytes):\"\n\n#: legacy/builder/constants/constants.go:128\nmsgid \"Sketch cannot be located in build path. Please specify a different build path\"\nmsgstr \"Sketch cannot be located in build path. Please specify a different build path\"\n\n#: cli/sketch/new.go:68\nmsgid \"Sketch created in: %s\"\nmsgstr \"Sketch created in: %s\"\n\n#: legacy/builder/constants/constants.go:124\nmsgid \"Sketch too big; see %s for tips on reducing it.\"\nmsgstr \"Sketch too big; see %s for tips on reducing it.\"\n\n#: legacy/builder/constants/constants.go:121\nmsgid \"Sketch uses {0} bytes ({2}%%) of program storage space. Maximum is {1} bytes.\"\nmsgstr \"Sketch uses {0} bytes ({2}%%) of program storage space. Maximum is {1} bytes.\"\n\n#: cli/compile/compile.go:137\n#: cli/sketch/archive.go:66\n#: cli/upload/upload.go:89\nmsgid \"Sketches with .pde extension are deprecated, please rename the following files to .ino:\"\nmsgstr \"Sketches with .pde extension are deprecated, please rename the following files to .ino:\"\n\n#: legacy/builder/phases/linker.go:35\nmsgid \"Skip linking of final executable.\"\nmsgstr \"Skip linking of final executable.\"\n\n#: commands/upload/upload.go:312\nmsgid \"Skipping 1200-bps touch reset: no serial port selected!\"\nmsgstr \"Skipping 1200-bps touch reset: no serial port selected!\"\n\n#: legacy/builder/builder_utils/utils.go:476\nmsgid \"Skipping archive creation of: {0}\"\nmsgstr \"Skipping archive creation of: {0}\"\n\n#: legacy/builder/builder_utils/utils.go:269\nmsgid \"Skipping compile of: {0}\"\nmsgstr \"Skipping compile of: {0}\"\n\n#: legacy/builder/constants/constants.go:103\nmsgid \"Skipping dependencies detection for precompiled library {0}\"\nmsgstr \"Skipping dependencies detection for precompiled library {0}\"\n\n#: commands/core/install.go:177\n#: commands/instances.go:834\nmsgid \"Skipping platform configuration\"\nmsgstr \"Skipping platform configuration\"\n\n#: legacy/builder/recipe_runner.go:58\nmsgid \"Skipping: {0}\"\nmsgstr \"Skipping: {0}\"\n\n#: arduino/serialutils/serialutils.go:133\nmsgid \"TOUCH: error during reset: %s\"\nmsgstr \"TOUCH: error during reset: %s\"\n\n#: cli/daemon/daemon.go:56\nmsgid \"The TCP port the daemon will listen to\"\nmsgstr \"The TCP port the daemon will listen to\"\n\n#: cli/board/attach.go:46\n#: cli/board/list.go:45\nmsgid \"The connected devices search timeout, raise it if your board doesn't show up (e.g. to %s).\"\nmsgstr \"The connected devices search timeout, raise it if your board doesn't show up (e.g. to %s).\"\n\n#: cli/cli.go:105\nmsgid \"The custom config file (if not specified the default will be used).\"\nmsgstr \"The custom config file (if not specified the default will be used).\"\n\n#: cli/core/install.go:66\nmsgid \"The flags --run-post-install and --skip-post-install can't be both set at the same time.\"\nmsgstr \"The flags --run-post-install and --skip-post-install can't be both set at the same time.\"\n\n#: cli/config/add.go:51\nmsgid \"The key '%[1]v' is not a list of items, can't add to it.\\n\"\n\"Maybe use '%[2]s'?\"\nmsgstr \"The key '%[1]v' is not a list of items, can't add to it.\\n\"\n\"Maybe use '%[2]s'?\"\n\n#: cli/config/remove.go:51\nmsgid \"The key '%[1]v' is not a list of items, can't remove from it.\\n\"\n\"Maybe use '%[2]s'?\"\nmsgstr \"The key '%[1]v' is not a list of items, can't remove from it.\\n\"\n\"Maybe use '%[2]s'?\"\n\n#: cli/cli.go:103\nmsgid \"The output format for the logs, can be {%s|%s}.\"\nmsgstr \"The output format for the logs, can be {%s|%s}.\"\n\n#: cli/cli.go:104\nmsgid \"The output format, can be {%s|%s}.\"\nmsgstr \"The output format, can be {%s|%s}.\"\n\n#: legacy/builder/phases/libraries_builder.go:151\nmsgid \"The platform does not support '{0}' for precompiled libraries.\"\nmsgstr \"The platform does not support '{0}' for precompiled libraries.\"\n\n#: cli/lib/upgrade.go:34\nmsgid \"This command upgrades an installed library to the latest available version. Multiple libraries can be passed separated by a space. If no arguments are provided, the command will upgrade all the installed libraries where an update is available.\"\nmsgstr \"This command upgrades an installed library to the latest available version. Multiple libraries can be passed separated by a space. If no arguments are provided, the command will upgrade all the installed libraries where an update is available.\"\n\n#: cli/outdated/outdated.go:39\nmsgid \"This commands shows a list of installed cores and/or libraries\\n\"\n\"that can be upgraded. If nothing needs to be updated the output is empty.\"\nmsgstr \"This commands shows a list of installed cores and/or libraries\\n\"\n\"that can be upgraded. If nothing needs to be updated the output is empty.\"\n\n#: commands/bundled_tools.go:45\n#: commands/core/install.go:81\n#: commands/instances.go:751\nmsgid \"Tool %s already installed\"\nmsgstr \"Tool %s already installed\"\n\n#: cli/debug/debug.go:154\nmsgid \"Toolchain custom configurations\"\nmsgstr \"Toolchain custom configurations\"\n\n#: cli/debug/debug.go:148\nmsgid \"Toolchain path\"\nmsgstr \"Toolchain path\"\n\n#: cli/debug/debug.go:149\nmsgid \"Toolchain prefix\"\nmsgstr \"Toolchain prefix\"\n\n#: cli/debug/debug.go:147\nmsgid \"Toolchain type\"\nmsgstr \"Toolchain type\"\n\n#: legacy/builder/constants/constants.go:118\nmsgid \"Ts: {0} - Running: {1}\"\nmsgstr \"Ts: {0} - Running: {1}\"\n\n#: cli/burnbootloader/burnbootloader.go:55\nmsgid \"Turns on verbose mode.\"\nmsgstr \"Turns on verbose mode.\"\n\n#: cli/board/list.go:92\n#: cli/board/list.go:131\nmsgid \"Type\"\nmsgstr \"Type\"\n\n#: cli/lib/search.go:171\nmsgid \"Types: %s\"\nmsgstr \"Types: %s\"\n\n#: cli/board/details.go:169\nmsgid \"URL:\"\nmsgstr \"URL:\"\n\n#: legacy/builder/constants/constants.go:95\nmsgid \"Unable to cache built core, please tell {0} maintainers to follow %s\"\nmsgstr \"Unable to cache built core, please tell {0} maintainers to follow %s\"\n\n#: legacy/builder/constants/constants.go:101\nmsgid \"Unable to find {0} in {1}\"\nmsgstr \"Unable to find {0} in {1}\"\n\n#: configuration/configuration.go:125\nmsgid \"Unable to get Documents Folder: %v\"\nmsgstr \"Unable to get Documents Folder: %v\"\n\n#: configuration/configuration.go:100\nmsgid \"Unable to get Local App Data Folder: %v\"\nmsgstr \"Unable to get Local App Data Folder: %v\"\n\n#: configuration/configuration.go:88\n#: configuration/configuration.go:113\nmsgid \"Unable to get user home dir: %v\"\nmsgstr \"Unable to get user home dir: %v\"\n\n#: cli/cli.go:171\nmsgid \"Unable to open file for logging: %s\"\nmsgstr \"Unable to open file for logging: %s\"\n\n#: commands/core/uninstall.go:82\n#: commands/lib/uninstall.go:39\nmsgid \"Uninstalling %s\"\nmsgstr \"Uninstalling %s\"\n\n#: commands/core/uninstall.go:98\n#: commands/instances.go:813\nmsgid \"Uninstalling %s, tool is no more required\"\nmsgstr \"Uninstalling %s, tool is no more required\"\n\n#: cli/core/uninstall.go:37\n#: cli/core/uninstall.go:38\nmsgid \"Uninstalls one or more cores and corresponding tool dependencies if no longer used.\"\nmsgstr \"Uninstalls one or more cores and corresponding tool dependencies if no longer used.\"\n\n#: cli/lib/uninstall.go:36\n#: cli/lib/uninstall.go:37\nmsgid \"Uninstalls one or more libraries.\"\nmsgstr \"Uninstalls one or more libraries.\"\n\n#: cli/board/list.go:161\nmsgid \"Unknown\"\nmsgstr \"Unknown\"\n\n#: legacy/builder/constants/constants.go:129\nmsgid \"Unknown sketch file extension: {0}\"\nmsgstr \"Unknown sketch file extension: {0}\"\n\n#: cli/update/update.go:40\nmsgid \"Updates the index of cores and libraries\"\nmsgstr \"Updates the index of cores and libraries\"\n\n#: cli/update/update.go:41\nmsgid \"Updates the index of cores and libraries to the latest versions.\"\nmsgstr \"Updates the index of cores and libraries to the latest versions.\"\n\n#: cli/core/update_index.go:36\nmsgid \"Updates the index of cores to the latest version.\"\nmsgstr \"Updates the index of cores to the latest version.\"\n\n#: cli/core/update_index.go:35\nmsgid \"Updates the index of cores.\"\nmsgstr \"Updates the index of cores.\"\n\n#: cli/lib/update_index.go:35\nmsgid \"Updates the libraries index to the latest version.\"\nmsgstr \"Updates the libraries index to the latest version.\"\n\n#: cli/lib/update_index.go:34\nmsgid \"Updates the libraries index.\"\nmsgstr \"Updates the libraries index.\"\n\n#: commands/instances.go:773\nmsgid \"Updating %s\"\nmsgstr \"Updating %s\"\n\n#: commands/instances.go:431\n#: commands/instances.go:457\n#: commands/instances.go:487\nmsgid \"Updating index: %s\"\nmsgstr \"Updating index: %s\"\n\n#: commands/instances.go:358\nmsgid \"Updating index: library_index.json.gz\"\nmsgstr \"Updating index: library_index.json.gz\"\n\n#: commands/instances.go:368\nmsgid \"Updating index: library_index.json.sig\"\nmsgstr \"Updating index: library_index.json.sig\"\n\n#: cli/upgrade/upgrade.go:40\nmsgid \"Upgrades installed cores and libraries to latest version.\"\nmsgstr \"Upgrades installed cores and libraries to latest version.\"\n\n#: cli/upgrade/upgrade.go:39\nmsgid \"Upgrades installed cores and libraries.\"\nmsgstr \"Upgrades installed cores and libraries.\"\n\n#: cli/lib/upgrade.go:33\nmsgid \"Upgrades installed libraries.\"\nmsgstr \"Upgrades installed libraries.\"\n\n#: cli/core/upgrade.go:37\n#: cli/core/upgrade.go:38\nmsgid \"Upgrades one or all installed platforms to the latest version.\"\nmsgstr \"Upgrades one or all installed platforms to the latest version.\"\n\n#: commands/core/install.go:117\nmsgid \"Upgrading %[1]s with %[2]s\"\nmsgstr \"Upgrading %[1]s with %[2]s\"\n\n#: cli/upload/upload.go:51\nmsgid \"Upload Arduino sketches.\"\nmsgstr \"Upload Arduino sketches.\"\n\n#: cli/upload/upload.go:52\nmsgid \"Upload Arduino sketches. This does NOT compile the sketch prior to upload.\"\nmsgstr \"Upload Arduino sketches. This does NOT compile the sketch prior to upload.\"\n\n#: commands/upload/upload.go:337\nmsgid \"Upload port found on %s\"\nmsgstr \"Upload port found on %s\"\n\n#: cli/burnbootloader/burnbootloader.go:53\n#: cli/compile/compile.go:100\n#: cli/upload/upload.go:60\nmsgid \"Upload port, e.g.: COM10 or /dev/ttyACM0\"\nmsgstr \"Upload port, e.g.: COM10 or /dev/ttyACM0\"\n\n#: cli/compile/compile.go:99\nmsgid \"Upload the binary after the compilation.\"\nmsgstr \"Upload the binary after the compilation.\"\n\n#: cli/burnbootloader/burnbootloader.go:46\nmsgid \"Upload the bootloader on the board using an external programmer.\"\nmsgstr \"Upload the bootloader on the board using an external programmer.\"\n\n#: cli/burnbootloader/burnbootloader.go:45\nmsgid \"Upload the bootloader.\"\nmsgstr \"Upload the bootloader.\"\n\n#: cli/usage.go:25\nmsgid \"Usage:\"\nmsgstr \"Usage:\"\n\n#: cli/usage.go:32\nmsgid \"Use %s for more information about a command.\"\nmsgstr \"Use %s for more information about a command.\"\n\n#: cli/burnbootloader/burnbootloader.go:56\nmsgid \"Use the specified programmer to upload.\"\nmsgstr \"Use the specified programmer to upload.\"\n\n#: arduino/libraries/librariesmanager/install.go:62\n#: arduino/libraries/librariesmanager/install.go:78\n#: arduino/libraries/librariesmanager/install.go:100\n#: arduino/libraries/librariesmanager/install.go:184\nmsgid \"User directory not set\"\nmsgstr \"User directory not set\"\n\n#: legacy/builder/constants/constants.go:132\nmsgid \"Using board '{0}' from platform in folder: {1}\"\nmsgstr \"Using board '{0}' from platform in folder: {1}\"\n\n#: legacy/builder/constants/constants.go:135\nmsgid \"Using cached library dependencies for file: {0}\"\nmsgstr \"Using cached library dependencies for file: {0}\"\n\n#: legacy/builder/constants/constants.go:133\nmsgid \"Using core '{0}' from platform in folder: {1}\"\nmsgstr \"Using core '{0}' from platform in folder: {1}\"\n\n#: legacy/builder/constants/constants.go:130\nmsgid \"Using library {0} at version {1} in folder: {2} {3}\"\nmsgstr \"Using library {0} at version {1} in folder: {2} {3}\"\n\n#: legacy/builder/constants/constants.go:131\nmsgid \"Using library {0} in folder: {1} {2}\"\nmsgstr \"Using library {0} in folder: {1} {2}\"\n\n#: legacy/builder/phases/core_builder.go:107\nmsgid \"Using precompiled core: {0}\"\nmsgstr \"Using precompiled core: {0}\"\n\n#: legacy/builder/phases/libraries_builder.go:98\n#: legacy/builder/phases/libraries_builder.go:106\nmsgid \"Using precompiled library in {0}\"\nmsgstr \"Using precompiled library in {0}\"\n\n#: legacy/builder/constants/constants.go:134\nmsgid \"Using previously compiled file: {0}\"\nmsgstr \"Using previously compiled file: {0}\"\n\n#: cli/core/download.go:36\n#: cli/core/install.go:37\nmsgid \"VERSION\"\nmsgstr \"VERSION\"\n\n#: cli/lib/check_deps.go:34\n#: cli/lib/install.go:38\nmsgid \"VERSION_NUMBER\"\nmsgstr \"VERSION_NUMBER\"\n\n#: cli/burnbootloader/burnbootloader.go:54\n#: cli/compile/compile.go:101\n#: cli/upload/upload.go:63\nmsgid \"Verify uploaded binary after the upload.\"\nmsgstr \"Verify uploaded binary after the upload.\"\n\n#: cli/core/search.go:114\nmsgid \"Version\"\nmsgstr \"Version\"\n\n#: cli/lib/search.go:172\nmsgid \"Versions: %s\"\nmsgstr \"Versions: %s\"\n\n#: legacy/builder/constants/constants.go:136\nmsgid \"WARNING: Category '{0}' in library {1} is not valid. Setting to '{2}'\"\nmsgstr \"WARNING: Category '{0}' in library {1} is not valid. Setting to '{2}'\"\n\n#: legacy/builder/constants/constants.go:138\nmsgid \"WARNING: Spurious {0} folder in '{1}' library\"\nmsgstr \"WARNING: Spurious {0} folder in '{1}' library\"\n\n#: commands/core/install.go:173\n#: commands/instances.go:830\nmsgid \"WARNING: cannot run post install: %s\"\nmsgstr \"WARNING: cannot run post install: %s\"\n\n#: legacy/builder/constants/constants.go:110\nmsgid \"WARNING: library {0} claims to run on {1} architecture(s) and may be incompatible with your current board which runs on {2} architecture(s).\"\nmsgstr \"WARNING: library {0} claims to run on {1} architecture(s) and may be incompatible with your current board which runs on {2} architecture(s).\"\n\n#: commands/upload/upload.go:326\nmsgid \"Waiting for upload port...\"\nmsgstr \"Waiting for upload port...\"\n\n#: legacy/builder/constants/constants.go:112\nmsgid \"Warning: Board {0}:{1}:{2} doesn''t define a %s preference. Auto-set to: {3}\"\nmsgstr \"Warning: Board {0}:{1}:{2} doesn''t define a %s preference. Auto-set to: {3}\"\n\n#: legacy/builder/constants/constants.go:137\nmsgid \"Warning: platform.txt from core '{0}' contains deprecated {1}, automatically converted to {2}. Consider upgrading this core.\"\nmsgstr \"Warning: platform.txt from core '{0}' contains deprecated {1}, automatically converted to {2}. Consider upgrading this core.\"\n\n#: commands/upload/upload.go:229\nmsgid \"Warning: tool '%s' is not installed. It might not be available for your OS.\"\nmsgstr \"Warning: tool '%s' is not installed. It might not be available for your OS.\"\n\n#: cli/lib/search.go:165\nmsgid \"Website: %s\"\nmsgstr \"Website: %s\"\n\n#: cli/compile/compile.go:102\nmsgid \"When specified, VID/PID specific build properties are used, if board supports them.\"\nmsgstr \"When specified, VID/PID specific build properties are used, if board supports them.\"\n\n#: cli/config/init.go:42\nmsgid \"Writes current configuration to a configuration file.\"\nmsgstr \"Writes current configuration to a configuration file.\"\n\n#: cli/config/init.go:45\nmsgid \"Writes current configuration to the configuration file in the data directory.\"\nmsgstr \"Writes current configuration to the configuration file in the data directory.\"\n\n#: cli/config/set.go:76\nmsgid \"Writing config file: %v\"\nmsgstr \"Writing config file: %v\"\n\n#: cli/core/list.go:88\n#: cli/core/search.go:118\nmsgid \"[DEPRECATED] %s\"\nmsgstr \"[DEPRECATED] %s\"\n\n#: commands/upload/upload.go:235\nmsgid \"a programmer is required to upload for this board\"\nmsgstr \"a programmer is required to upload for this board\"\n\n#: arduino/discovery/discovery.go:340\nmsgid \"already in events mode\"\nmsgstr \"already in events mode\"\n\n#: commands/sketch/archive.go:70\nmsgid \"archive already exists\"\nmsgstr \"archive already exists\"\n\n#: arduino/resources/checksums.go:80\nmsgid \"archive hash differs from hash in index\"\nmsgstr \"archive hash differs from hash in index\"\n\n#: arduino/libraries/librariesmanager/install.go:131\nmsgid \"archive is not valid: multiple files found in zip file top level\"\nmsgstr \"archive is not valid: multiple files found in zip file top level\"\n\n#: cli/sketch/archive.go:38\nmsgid \"archivePath\"\nmsgstr \"archivePath\"\n\n#: legacy/builder/preprocess_sketch.go:103\nmsgid \"arduino-preprocessor pattern is missing\"\nmsgstr \"arduino-preprocessor pattern is missing\"\n\n#: commands/upload/upload.go:477\nmsgid \"autodetect build artifact: %s\"\nmsgstr \"autodetect build artifact: %s\"\n\n#: commands/upload/upload.go:462\nmsgid \"binary file not found in %s\"\nmsgstr \"binary file not found in %s\"\n\n#: arduino/cores/packagemanager/package_manager.go:180\nmsgid \"board %s:%s not found\"\nmsgstr \"board %s:%s not found\"\n\n#: commands/board/list.go:40\nmsgid \"board not found\"\nmsgstr \"board not found\"\n\n#: cli/board/listall.go:35\n#: cli/board/search.go:36\nmsgid \"boardname\"\nmsgstr \"boardname\"\n\n#: commands/upload/upload.go:376\nmsgid \"burn bootloader error: %s\"\nmsgstr \"burn bootloader error: %s\"\n\n#: commands/instances.go:506\nmsgid \"can't create data directory %[1]s: %[2]s\"\nmsgstr \"can't create data directory %[1]s: %[2]s\"\n\n#: commands/core/install.go:130\nmsgid \"can't find dependencies for platform %[1]s: %[2]w\"\nmsgstr \"can't find dependencies for platform %[1]s: %[2]w\"\n\n#: arduino/cores/status.go:123\nmsgid \"can't find latest release of %s\"\nmsgstr \"can't find latest release of %s\"\n\n#: arduino/sketch/sketch.go:100\nmsgid \"can't find main Sketch file in %s\"\nmsgstr \"can't find main Sketch file in %s\"\n\n#: executils/output.go:52\nmsgid \"can't retrieve standard error stream: %s\"\nmsgstr \"can't retrieve standard error stream: %s\"\n\n#: executils/output.go:34\nmsgid \"can't retrieve standard output stream: %s\"\nmsgstr \"can't retrieve standard output stream: %s\"\n\n#: commands/compile/compile.go:181\nmsgid \"cannot create build cache directory: %s\"\nmsgstr \"cannot create build cache directory: %s\"\n\n#: commands/compile/compile.go:151\nmsgid \"cannot create build directory: %s\"\nmsgstr \"cannot create build directory: %s\"\n\n#: commands/upload/upload.go:419\n#: commands/upload/upload.go:426\nmsgid \"cannot execute upload tool: %s\"\nmsgstr \"cannot execute upload tool: %s\"\n\n#: commands/board/attach.go:107\nmsgid \"cannot export sketch metadata: %s\"\nmsgstr \"cannot export sketch metadata: %s\"\n\n#: commands/upload/upload.go:180\nmsgid \"cannot get programmer tool: undefined '%s' property\"\nmsgstr \"cannot get programmer tool: undefined '%s' property\"\n\n#: commands/instances.go:696\n#: commands/lib/install.go:97\nmsgid \"checking lib install prerequisites: %s\"\nmsgstr \"checking lib install prerequisites: %s\"\n\n#: arduino/resources/install.go:39\nmsgid \"checking local archive integrity\"\nmsgstr \"checking local archive integrity\"\n\n#: commands/upload/upload.go:373\nmsgid \"chip erase error: %s\"\nmsgstr \"chip erase error: %s\"\n\n#: legacy/builder/wipeout_build_path_if_build_options_changed.go:85\n#: legacy/builder/wipeout_build_path_if_build_options_changed.go:89\nmsgid \"cleaning build path\"\nmsgstr \"cleaning build path\"\n\n#: cli/cli.go:69\nmsgid \"command\"\nmsgstr \"command\"\n\n#: arduino/discovery/discovery.go:229\n#: arduino/discovery/discovery.go:247\n#: arduino/discovery/discovery.go:264\n#: arduino/discovery/discovery.go:286\n#: arduino/discovery/discovery.go:309\n#: arduino/discovery/discovery.go:351\nmsgid \"command failed: %s\"\nmsgstr \"command failed: %s\"\n\n#: arduino/discovery/discovery.go:227\nmsgid \"communication out of sync, expected 'hello', received '%s'\"\nmsgstr \"communication out of sync, expected 'hello', received '%s'\"\n\n#: arduino/discovery/discovery.go:307\nmsgid \"communication out of sync, expected 'list', received '%s'\"\nmsgstr \"communication out of sync, expected 'list', received '%s'\"\n\n#: arduino/discovery/discovery.go:284\nmsgid \"communication out of sync, expected 'quit', received '%s'\"\nmsgstr \"communication out of sync, expected 'quit', received '%s'\"\n\n#: arduino/discovery/discovery.go:245\nmsgid \"communication out of sync, expected 'start', received '%s'\"\nmsgstr \"communication out of sync, expected 'start', received '%s'\"\n\n#: arduino/discovery/discovery.go:349\nmsgid \"communication out of sync, expected 'start_sync', received '%s'\"\nmsgstr \"communication out of sync, expected 'start_sync', received '%s'\"\n\n#: arduino/discovery/discovery.go:262\nmsgid \"communication out of sync, expected 'stop', received '%s'\"\nmsgstr \"communication out of sync, expected 'stop', received '%s'\"\n\n#: commands/debug/debug_info.go:123\n#: commands/upload/upload.go:286\nmsgid \"compiled sketch not found in %s\"\nmsgstr \"compiled sketch not found in %s\"\n\n#: arduino/resources/checksums.go:76\nmsgid \"computing hash: %s\"\nmsgstr \"computing hash: %s\"\n\n#: commands/compile/compile.go:282\n#: commands/lib/list.go:108\nmsgid \"converting library %[1]s to rpc struct: %[2]w\"\nmsgstr \"converting library %[1]s to rpc struct: %[2]w\"\n\n#: commands/compile/compile.go:273\nmsgid \"copying output file %s\"\nmsgstr \"copying output file %s\"\n\n#: commands/upload/upload.go:534\nmsgid \"could not find a valid build artifact\"\nmsgstr \"could not find a valid build artifact\"\n\n#: arduino/cores/packagemanager/install_uninstall.go:45\nmsgid \"creating installed.json in %[1]s: %[2]s\"\nmsgstr \"creating installed.json in %[1]s: %[2]s\"\n\n#: commands/compile/compile.go:253\nmsgid \"creating output dir\"\nmsgstr \"creating output dir\"\n\n#: arduino/resources/install.go:44\n#: arduino/resources/install.go:48\nmsgid \"creating temp dir for extraction: %s\"\nmsgstr \"creating temp dir for extraction: %s\"\n\n#: commands/instances.go:440\n#: commands/instances.go:442\nmsgid \"creating temp file for index download: %s\"\nmsgstr \"creating temp file for index download: %s\"\n\n#: commands/instances.go:473\n#: commands/instances.go:475\nmsgid \"creating temp file for index signature download: %s\"\nmsgstr \"creating temp file for index signature download: %s\"\n\n#: legacy/builder/phases/sizer.go:116\nmsgid \"data section exceeds available space in board\"\nmsgstr \"data section exceeds available space in board\"\n\n#: commands/debug/debug_info.go:149\nmsgid \"debugging not supported for board %s\"\nmsgstr \"debugging not supported for board %s\"\n\n#: arduino/sketch/sketch.go:206\nmsgid \"decoding sketch metadata: %s\"\nmsgstr \"decoding sketch metadata: %s\"\n\n#: commands/lib/resolve_deps.go:51\nmsgid \"dependency '%s' is not available\"\nmsgstr \"dependency '%s' is not available\"\n\n#: legacy/builder/utils/utils.go:471\nmsgid \"destination already exists\"\nmsgstr \"destination already exists\"\n\n#: arduino/libraries/librariesmanager/install.go:69\nmsgid \"destination dir %s already exists, cannot install\"\nmsgstr \"destination dir %s already exists, cannot install\"\n\n#: cli/core/download.go:36\nmsgid \"download [%s:%s[@%s]]...\"\nmsgstr \"download [%s:%s[@%s]]...\"\n\n#: cli/core/install.go:42\nmsgid \"download a specific version (in this case 1.6.9).\"\nmsgstr \"download a specific version (in this case 1.6.9).\"\n\n#: cli/core/install.go:40\nmsgid \"download the latest version of Arduino SAMD core.\"\nmsgstr \"download the latest version of Arduino SAMD core.\"\n\n#: commands/instances.go:95\nmsgid \"downloading %[1]s tool: %[2]s\"\nmsgstr \"downloading %[1]s tool: %[2]s\"\n\n#: commands/instances.go:450\n#: commands/instances.go:454\n#: commands/instances.go:459\nmsgid \"downloading index %[1]s: %[2]s\"\nmsgstr \"downloading index %[1]s: %[2]s\"\n\n#: commands/instances.go:489\nmsgid \"downloading index signature %[1]s: %[2]s\"\nmsgstr \"downloading index signature %[1]s: %[2]s\"\n\n#: commands/lib/install.go:72\nmsgid \"downloading library: %s\"\nmsgstr \"downloading library: %s\"\n\n#: commands/instances.go:359\nmsgid \"downloading library_index.json.gz\"\nmsgstr \"downloading library_index.json.gz\"\n\n#: commands/instances.go:369\nmsgid \"downloading library_index.json.sig\"\nmsgstr \"downloading library_index.json.sig\"\n\n#: commands/core/download.go:61\nmsgid \"downloading tool %[1]s: %[2]s\"\nmsgstr \"downloading tool %[1]s: %[2]s\"\n\n#: arduino/sketch/sketch.go:195\nmsgid \"encoding sketch metadata: %s\"\nmsgstr \"encoding sketch metadata: %s\"\n\n#: commands/board/list.go:145\nmsgid \"error getting board info from Arduino Cloud\"\nmsgstr \"error getting board info from Arduino Cloud\"\n\n#: commands/board/list.go:198\nmsgid \"error getting port list from %s\"\nmsgstr \"error getting port list from %s\"\n\n#: commands/instances.go:848\nmsgid \"error loading sketch %[1]v: %[2]v\"\nmsgstr \"error loading sketch %[1]v: %[2]v\"\n\n#: arduino/monitors/serial.go:44\nmsgid \"error opening serial monitor\"\nmsgstr \"error opening serial monitor\"\n\n#: commands/debug/debug_info.go:65\nmsgid \"error parsing FQBN\"\nmsgstr \"error parsing FQBN\"\n\n#: cli/config/set.go:68\nmsgid \"error parsing value: %v\"\nmsgstr \"error parsing value: %v\"\n\n#: commands/board/list.go:82\nmsgid \"error processing response from server\"\nmsgstr \"error processing response from server\"\n\n#: commands/board/list.go:99\nmsgid \"error querying Arduino Cloud Api\"\nmsgstr \"error querying Arduino Cloud Api\"\n\n#: commands/debug/debug_info.go:71\nmsgid \"error resolving FQBN\"\nmsgstr \"error resolving FQBN\"\n\n#: cli/upload/upload.go:73\nmsgid \"error: %s and %s flags cannot be used together\"\nmsgstr \"error: %s and %s flags cannot be used together\"\n\n#: commands/debug/debug_info.go:126\n#: commands/upload/upload.go:289\nmsgid \"expected compiled sketch in directory %s, but is a file instead\"\nmsgstr \"expected compiled sketch in directory %s, but is a file instead\"\n\n#: arduino/resources/install.go:67\nmsgid \"extracting archive: %s\"\nmsgstr \"extracting archive: %s\"\n\n#: arduino/libraries/librariesmanager/install.go:119\nmsgid \"extracting archive: %w\"\nmsgstr \"extracting archive: %w\"\n\n#: arduino/resources/checksums.go:145\nmsgid \"failed to compute hash of file \\\"%s\\\"\"\nmsgstr \"failed to compute hash of file \\\"%s\\\"\"\n\n#: commands/board/list.go:65\nmsgid \"failed to initialize http client\"\nmsgstr \"failed to initialize http client\"\n\n#: arduino/resources/checksums.go:97\nmsgid \"fetched archive size differs from size specified in index\"\nmsgstr \"fetched archive size differs from size specified in index\"\n\n#: arduino/resources/install.go:132\nmsgid \"files in archive must be placed in a subdirectory\"\nmsgstr \"files in archive must be placed in a subdirectory\"\n\n#: arduino/cores/packagemanager/loader.go:65\nmsgid \"find abs path: %s\"\nmsgstr \"find abs path: %s\"\n\n#: commands/core/download.go:50\nmsgid \"find platform dependencies: %s\"\nmsgstr \"find platform dependencies: %s\"\n\n#: commands/core/install.go:49\n#: commands/core/uninstall.go:56\nmsgid \"finding platform dependencies: %s\"\nmsgstr \"finding platform dependencies: %s\"\n\n#: commands/daemon/monitor.go:45\nmsgid \"first message must contain monitor configuration, not data\"\nmsgstr \"first message must contain monitor configuration, not data\"\n\n#: cli/cli.go:69\nmsgid \"flags\"\nmsgstr \"flags\"\n\n#: arduino/cores/packagemanager/loader.go:107\nmsgid \"following possible symlink %[1]s: %[2]s\"\nmsgstr \"following possible symlink %[1]s: %[2]s\"\n\n#: cli/core/download.go:41\nmsgid \"for a specific version (in this case 1.6.9).\"\nmsgstr \"for a specific version (in this case 1.6.9).\"\n\n#: cli/lib/download.go:39\nmsgid \"for a specific version.\"\nmsgstr \"for a specific version.\"\n\n#: cli/lib/check_deps.go:38\n#: cli/lib/download.go:38\n#: cli/lib/install.go:42\nmsgid \"for the latest version.\"\nmsgstr \"for the latest version.\"\n\n#: cli/lib/check_deps.go:39\n#: cli/lib/install.go:43\nmsgid \"for the specific version.\"\nmsgstr \"for the specific version.\"\n\n#: arduino/libraries/libraries.go:114\nmsgid \"gathering library headers: %w\"\nmsgstr \"gathering library headers: %w\"\n\n#: inventory/inventory.go:67\nmsgid \"generating installation.id: %w\"\nmsgstr \"generating installation.id: %w\"\n\n#: inventory/inventory.go:73\nmsgid \"generating installation.secret: %w\"\nmsgstr \"generating installation.secret: %w\"\n\n#: arduino/resources/helpers.go:68\nmsgid \"getting archive file info: %s\"\nmsgstr \"getting archive file info: %s\"\n\n#: arduino/resources/checksums.go:94\nmsgid \"getting archive info: %s\"\nmsgstr \"getting archive info: %s\"\n\n#: arduino/resources/checksums.go:67\n#: arduino/resources/checksums.go:90\n#: arduino/resources/helpers.go:40\n#: arduino/resources/helpers.go:49\n#: arduino/resources/install.go:55\nmsgid \"getting archive path: %s\"\nmsgstr \"getting archive path: %s\"\n\n#: arduino/cores/packagemanager/package_manager.go:186\nmsgid \"getting build properties for board %[1]s: %[2]s\"\nmsgstr \"getting build properties for board %[1]s: %[2]s\"\n\n#: arduino/cores/packagemanager/download.go:103\nmsgid \"getting discovery dependencies for platform %[1]s: %[2]s\"\nmsgstr \"getting discovery dependencies for platform %[1]s: %[2]s\"\n\n#: arduino/cores/packagemanager/loader.go:564\nmsgid \"getting parent dir of %[1]s: %[2]s\"\nmsgstr \"getting parent dir of %[1]s: %[2]s\"\n\n#: commands/bundled_tools_serial_discovery.go:138\nmsgid \"getting port list from discovery: %v\"\nmsgstr \"getting port list from discovery: %v\"\n\n#: arduino/cores/packagemanager/download.go:96\nmsgid \"getting tool dependencies for platform %[1]s: %[2]s\"\nmsgstr \"getting tool dependencies for platform %[1]s: %[2]s\"\n\n#: arduino/sketch/sketch.go:150\nmsgid \"importing sketch metadata: %s\"\nmsgstr \"importing sketch metadata: %s\"\n\n#: commands/compile/compile.go:115\n#: commands/upload/programmers_list.go:37\n#: commands/upload/programmers_list.go:43\n#: commands/upload/upload.go:131\n#: commands/upload/upload.go:138\nmsgid \"incorrect FQBN: %s\"\nmsgstr \"incorrect FQBN: %s\"\n\n#: commands/instances.go:497\nmsgid \"index has an invalid signature\"\nmsgstr \"index has an invalid signature\"\n\n#: arduino/libraries/librariesmanager/install.go:86\nmsgid \"install directory not set\"\nmsgstr \"install directory not set\"\n\n#: commands/instances.go:99\nmsgid \"installing %[1]s tool: %[2]s\"\nmsgstr \"installing %[1]s tool: %[2]s\"\n\n#: arduino/cores/packagemanager/install_uninstall.go:37\nmsgid \"installing platform %[1]s: %[2]s\"\nmsgstr \"installing platform %[1]s: %[2]s\"\n\n#: commands/bundled_tools.go:54\nmsgid \"installing tool %[1]s: %[2]s\"\nmsgstr \"installing tool %[1]s: %[2]s\"\n\n#: arduino/discovery/discovery.go:134\nmsgid \"invalid 'add' message: missing port\"\nmsgstr \"invalid 'add' message: missing port\"\n\n#: arduino/discovery/discovery.go:145\nmsgid \"invalid 'remove' message: missing port\"\nmsgstr \"invalid 'remove' message: missing port\"\n\n#: commands/upload/upload.go:196\nmsgid \"invalid 'upload.tool' property: %s\"\nmsgstr \"invalid 'upload.tool' property: %s\"\n\n#: commands/board/attach.go:66\n#: commands/upload/upload.go:115\nmsgid \"invalid Device URL format: %s\"\nmsgstr \"invalid Device URL format: %s\"\n\n#: arduino/resources/checksums.go:45\nmsgid \"invalid checksum format: %s\"\nmsgstr \"invalid checksum format: %s\"\n\n#: commands/board/attach.go:76\nmsgid \"invalid device port type provided\"\nmsgstr \"invalid device port type provided\"\n\n#: cli/globals/args.go:82\nmsgid \"invalid empty core architecture '%s'\"\nmsgstr \"invalid empty core architecture '%s'\"\n\n#: cli/globals/args.go:58\nmsgid \"invalid empty core argument\"\nmsgstr \"invalid empty core argument\"\n\n#: cli/globals/args.go:78\nmsgid \"invalid empty core name '%s'\"\nmsgstr \"invalid empty core name '%s'\"\n\n#: cli/globals/args.go:62\nmsgid \"invalid empty core reference '%s'\"\nmsgstr \"invalid empty core reference '%s'\"\n\n#: cli/globals/args.go:67\nmsgid \"invalid empty core version: '%s'\"\nmsgstr \"invalid empty core version: '%s'\"\n\n#: cli/lib/args.go:49\nmsgid \"invalid empty library name\"\nmsgstr \"invalid empty library name\"\n\n#: cli/lib/args.go:54\nmsgid \"invalid empty library version: %s\"\nmsgstr \"invalid empty library version: %s\"\n\n#: arduino/cores/board.go:123\nmsgid \"invalid empty option found\"\nmsgstr \"invalid empty option found\"\n\n#: arduino/cores/fqbn.go:54\n#: arduino/cores/fqbn.go:59\nmsgid \"invalid fqbn config: %s\"\nmsgstr \"invalid fqbn config: %s\"\n\n#: arduino/cores/fqbn.go:48\nmsgid \"invalid fqbn: empty board identifier\"\nmsgstr \"invalid fqbn: empty board identifier\"\n\n#: arduino/libraries/librariesmanager/install.go:250\nmsgid \"invalid git url\"\nmsgstr \"invalid git url\"\n\n#: commands/instances.go:325\n#: commands/instances.go:337\n#: commands/instances.go:406\n#: commands/instances.go:668\n#: commands/instances.go:713\nmsgid \"invalid handle\"\nmsgstr \"invalid handle\"\n\n#: arduino/resources/checksums.go:49\nmsgid \"invalid hash '%[1]s': %[2]s\"\nmsgstr \"invalid hash '%[1]s': %[2]s\"\n\n#: commands/board/attach.go:42\n#: commands/board/details.go:33\n#: commands/board/list.go:193\n#: commands/board/listall.go:36\n#: commands/board/search.go:36\n#: commands/compile/compile.go:93\n#: commands/core/download.go:36\n#: commands/core/install.go:35\n#: commands/core/list.go:38\n#: commands/core/search.go:40\n#: commands/core/uninstall.go:33\n#: commands/core/upgrade.go:40\n#: commands/instances.go:547\n#: commands/instances.go:570\n#: commands/lib/list.go:41\n#: commands/lib/list.go:46\n#: commands/lib/search.go:35\nmsgid \"invalid instance\"\nmsgstr \"invalid instance\"\n\n#: cli/globals/args.go:75\nmsgid \"invalid item %s\"\nmsgstr \"invalid item %s\"\n\n#: arduino/libraries/libraries_layout.go:53\nmsgid \"invalid library layout value: %d\"\nmsgstr \"invalid library layout value: %d\"\n\n#: arduino/libraries/libraries_layout.go:68\nmsgid \"invalid library layout: %s\"\nmsgstr \"invalid library layout: %s\"\n\n#: arduino/libraries/libraries_location.go:73\nmsgid \"invalid library location value: %d\"\nmsgstr \"invalid library location value: %d\"\n\n#: arduino/libraries/libraries_location.go:94\nmsgid \"invalid library location: %s\"\nmsgstr \"invalid library location: %s\"\n\n#: arduino/cores/board.go:125\nmsgid \"invalid option '%s'\"\nmsgstr \"invalid option '%s'\"\n\n#: commands/instances.go:426\n#: commands/instances.go:502\nmsgid \"invalid package index in %[1]s: %[2]s\"\nmsgstr \"invalid package index in %[1]s: %[2]s\"\n\n#: inventory/inventory.go:85\nmsgid \"invalid path creating config dir: %[1]s error: %[2]w\"\nmsgstr \"invalid path creating config dir: %[1]s error: %[2]w\"\n\n#: inventory/inventory.go:91\nmsgid \"invalid path writing inventory file: %[1]s error: %[2]w\"\nmsgstr \"invalid path writing inventory file: %[1]s error: %[2]w\"\n\n#: arduino/cores/packageindex/index.go:239\nmsgid \"invalid platform archive size: %s\"\nmsgstr \"invalid platform archive size: %s\"\n\n#: commands/upload/upload.go:406\nmsgid \"invalid recipe '%[1]s': %[2]s\"\nmsgstr \"invalid recipe '%[1]s': %[2]s\"\n\n#: arduino/cores/board.go:109\nmsgid \"invalid value '%[1]s' for option '%[2]s'\"\nmsgstr \"invalid value '%[1]s' for option '%[2]s'\"\n\n#: arduino/cores/packagemanager/loader.go:279\nmsgid \"invalid version dir %[1]s: %[2]s\"\nmsgstr \"invalid version dir %[1]s: %[2]s\"\n\n#: commands/core/download.go:41\n#: commands/core/install.go:40\n#: commands/lib/utils.go:34\nmsgid \"invalid version: %s\"\nmsgstr \"invalid version: %s\"\n\n#: commands/daemon/settings.go:108\nmsgid \"key not found in settings\"\nmsgstr \"key not found in settings\"\n\n#: cli/core/search.go:48\nmsgid \"keywords\"\nmsgstr \"keywords\"\n\n#: arduino/libraries/librariesmanager/install.go:157\n#: arduino/libraries/librariesmanager/install.go:200\nmsgid \"library %s already installed\"\nmsgstr \"library %s already installed\"\n\n#: commands/lib/utils.go:47\nmsgid \"library %s not found\"\nmsgstr \"library %s not found\"\n\n#: arduino/libraries/librariesmanager/install.go:38\nmsgid \"library already installed\"\nmsgstr \"library already installed\"\n\n#: arduino/libraries/librariesmanager/install.go:269\nmsgid \"library is not valid: missing file \\\"library.properties\\\"\"\nmsgstr \"library is not valid: missing file \\\"library.properties\\\"\"\n\n#: arduino/libraries/librariesmanager/install.go:264\nmsgid \"library is not valid: missing header file \\\"%s\\\"\"\nmsgstr \"library is not valid: missing header file \\\"%s\\\"\"\n\n#: arduino/libraries/librariesmanager/librariesmanager.go:226\nmsgid \"library path does not exist: %s\"\nmsgstr \"library path does not exist: %s\"\n\n#: commands/instances.go:385\nmsgid \"library_index.json has an invalid signature\"\nmsgstr \"library_index.json has an invalid signature\"\n\n#: arduino/serialutils/serialutils.go:61\nmsgid \"listing serial ports\"\nmsgstr \"listing serial ports\"\n\n#: arduino/cores/packagemanager/loader.go:306\n#: arduino/cores/packagemanager/loader.go:315\n#: arduino/cores/packagemanager/loader.go:320\nmsgid \"loading %[1]s: %[2]s\"\nmsgstr \"loading %[1]s: %[2]s\"\n\n#: commands/board/details.go:44\n#: commands/lib/list.go:60\nmsgid \"loading board data: %s\"\nmsgstr \"loading board data: %s\"\n\n#: arduino/cores/packagemanager/loader.go:349\nmsgid \"loading boards: %s\"\nmsgstr \"loading boards: %s\"\n\n#: arduino/cores/packagemanager/loader.go:519\nmsgid \"loading bundled tools from %[1]s: %[2]s\"\nmsgstr \"loading bundled tools from %[1]s: %[2]s\"\n\n#: arduino/cores/packagemanager/package_manager.go:221\n#: arduino/cores/packagemanager/package_manager.go:236\nmsgid \"loading json index file %[1]s: %[2]s\"\nmsgstr \"loading json index file %[1]s: %[2]s\"\n\n#: arduino/libraries/librariesmanager/librariesmanager.go:205\n#: arduino/libraries/librariesmanager/librariesmanager.go:231\nmsgid \"loading library from %[1]s: %[2]s\"\nmsgstr \"loading library from %[1]s: %[2]s\"\n\n#: arduino/libraries/loader.go:47\nmsgid \"loading library.properties: %s\"\nmsgstr \"loading library.properties: %s\"\n\n#: arduino/cores/packagemanager/loader.go:255\n#: arduino/cores/packagemanager/loader.go:283\nmsgid \"loading platform release %[1]s: %[2]s\"\nmsgstr \"loading platform release %[1]s: %[2]s\"\n\n#: arduino/cores/packagemanager/loader.go:206\nmsgid \"loading platform.txt: %v\"\nmsgstr \"loading platform.txt: %v\"\n\n#: arduino/cores/packagemanager/loader.go:486\nmsgid \"loading tool release in %[1]s: %[2]s\"\nmsgstr \"loading tool release in %[1]s: %[2]s\"\n\n#: arduino/cores/packagemanager/loader.go:199\nmsgid \"looking for boards.txt in %[1]s: %[2]s\"\nmsgstr \"looking for boards.txt in %[1]s: %[2]s\"\n\n#: commands/lib/download.go:42\n#: commands/lib/install.go:68\n#: commands/lib/resolve_deps.go:34\nmsgid \"looking for library: %s\"\nmsgstr \"looking for library: %s\"\n\n#: legacy/builder/container_setup.go:74\nmsgid \"main file missing from sketch\"\nmsgstr \"main file missing from sketch\"\n\n#: commands/compile/compile.go:259\nmsgid \"missing 'build.project_name' build property\"\nmsgstr \"missing 'build.project_name' build property\"\n\n#: arduino/resources/checksums.go:41\nmsgid \"missing checksum for: %s\"\nmsgstr \"missing checksum for: %s\"\n\n#: arduino/cores/packagemanager/package_manager.go:198\nmsgid \"missing package %[1]s referenced by board %[2]s\"\nmsgstr \"missing package %[1]s referenced by board %[2]s\"\n\n#: arduino/cores/packagemanager/package_manager.go:203\nmsgid \"missing platform %[1]s:%[2]s referenced by board %[3]s\"\nmsgstr \"missing platform %[1]s:%[2]s referenced by board %[3]s\"\n\n#: arduino/cores/packagemanager/package_manager.go:208\nmsgid \"missing platform release %[1]s:%[2]s referenced by board %[3]s\"\nmsgstr \"missing platform release %[1]s:%[2]s referenced by board %[3]s\"\n\n#: commands/bundled_tools_serial_discovery.go:119\n#: commands/bundled_tools_serial_discovery.go:148\nmsgid \"missing serial-discovery tool\"\nmsgstr \"missing serial-discovery tool\"\n\n#: commands/compile/compile.go:98\n#: commands/debug/debug_info.go:47\nmsgid \"missing sketchPath\"\nmsgstr \"missing sketchPath\"\n\n#: arduino/libraries/librariesmanager/install.go:174\n#: arduino/resources/install.go:94\nmsgid \"moving extracted archive to destination dir: %s\"\nmsgstr \"moving extracted archive to destination dir: %s\"\n\n#: commands/upload/upload.go:529\nmsgid \"multiple build artifacts found: '%[1]s' and '%[2]s'\"\nmsgstr \"multiple build artifacts found: '%[1]s' and '%[2]s'\"\n\n#: arduino/sketch/sketch.go:73\nmsgid \"multiple main sketch files found (%[1]v, %[2]v)\"\nmsgstr \"multiple main sketch files found (%[1]v, %[2]v)\"\n\n#: commands/compile/compile.go:111\nmsgid \"no FQBN provided\"\nmsgstr \"no FQBN provided\"\n\n#: commands/debug/debug_info.go:61\n#: commands/upload/programmers_list.go:33\n#: commands/upload/upload.go:127\nmsgid \"no Fully Qualified Board Name provided\"\nmsgstr \"no Fully Qualified Board Name provided\"\n\n#: arduino/cores/packagemanager/install_uninstall.go:127\nmsgid \"no compatible version of %s tools found for the current os\"\nmsgstr \"no compatible version of %s tools found for the current os\"\n\n#: executils/process.go:37\nmsgid \"no executable specified\"\nmsgstr \"no executable specified\"\n\n#: commands/daemon/daemon.go:82\nmsgid \"no instance specified\"\nmsgstr \"no instance specified\"\n\n#: commands/upload/upload.go:108\nmsgid \"no programmer specified for burning bootloader\"\nmsgstr \"no programmer specified for burning bootloader\"\n\n#: commands/upload/upload.go:484\nmsgid \"no sketch or build directory/file specified\"\nmsgstr \"no sketch or build directory/file specified\"\n\n#: commands/board/attach.go:92\nmsgid \"no supported board found at %s\"\nmsgstr \"no supported board found at %s\"\n\n#: arduino/resources/install.go:128\nmsgid \"no unique root dir in archive, found '%[1]s' and '%[2]s'\"\nmsgstr \"no unique root dir in archive, found '%[1]s' and '%[2]s'\"\n\n#: commands/upload/upload.go:401\nmsgid \"no upload port provided\"\nmsgstr \"no upload port provided\"\n\n#: arduino/sketch/sketch.go:258\nmsgid \"no valid sketch found in %[1]s: missing %[2]s\"\nmsgstr \"no valid sketch found in %[1]s: missing %[2]s\"\n\n#: commands/lib/resolve_deps.go:56\nmsgid \"no valid solution found\"\nmsgstr \"no valid solution found\"\n\n#: arduino/resources/checksums.go:72\n#: arduino/resources/install.go:59\nmsgid \"opening archive file: %s\"\nmsgstr \"opening archive file: %s\"\n\n#: arduino/cores/packagemanager/loader.go:272\nmsgid \"opening boards.txt: %s\"\nmsgstr \"opening boards.txt: %s\"\n\n#: arduino/serialutils/serialutils.go:37\nmsgid \"opening port at 1200bps\"\nmsgstr \"opening port at 1200bps\"\n\n#: arduino/security/signatures.go:81\nmsgid \"opening signature file: %s\"\nmsgstr \"opening signature file: %s\"\n\n#: commands/debug/debug_info.go:52\nmsgid \"opening sketch\"\nmsgstr \"opening sketch\"\n\n#: commands/board/attach.go:50\n#: commands/compile/compile.go:103\n#: commands/upload/upload.go:52\nmsgid \"opening sketch: %s\"\nmsgstr \"opening sketch: %s\"\n\n#: arduino/security/signatures.go:76\nmsgid \"opening target file: %s\"\nmsgstr \"opening target file: %s\"\n\n#: arduino/cores/packagemanager/download.go:73\n#: arduino/cores/status.go:88\n#: arduino/cores/status.go:113\nmsgid \"package %s not found\"\nmsgstr \"package %s not found\"\n\n#: arduino/cores/packagemanager/package_manager.go:250\nmsgid \"package '%s' not found\"\nmsgstr \"package '%s' not found\"\n\n#: arduino/cores/status.go:167\nmsgid \"package not found\"\nmsgstr \"package not found\"\n\n#: arduino/cores/packagemanager/loader.go:226\nmsgid \"parsing IDE bundled index: %s\"\nmsgstr \"parsing IDE bundled index: %s\"\n\n#: arduino/cores/board.go:139\n#: arduino/cores/packagemanager/package_manager.go:127\n#: commands/board/details.go:38\n#: commands/lib/list.go:56\nmsgid \"parsing fqbn: %s\"\nmsgstr \"parsing fqbn: %s\"\n\n#: arduino/libraries/librariesindex/json.go:69\nmsgid \"parsing library_index.json: %s\"\nmsgstr \"parsing library_index.json: %s\"\n\n#: commands/instances.go:468\nmsgid \"parsing url for index signature check: %s\"\nmsgstr \"parsing url for index signature check: %s\"\n\n#: arduino/cores/packagemanager/loader.go:188\nmsgid \"path is not a platform directory: %s\"\nmsgstr \"path is not a platform directory: %s\"\n\n#: arduino/cores/packagemanager/download.go:77\nmsgid \"platform %[1]s not found in package %[2]s\"\nmsgstr \"platform %[1]s not found in package %[2]s\"\n\n#: arduino/cores/packagemanager/download.go:89\nmsgid \"platform %s has no available releases\"\nmsgstr \"platform %s has no available releases\"\n\n#: arduino/cores/packagemanager/package_manager.go:173\n#: commands/core/upgrade.go:74\n#: commands/core/upgrade.go:84\n#: commands/instances.go:744\nmsgid \"platform %s is not installed\"\nmsgstr \"platform %s is not installed\"\n\n#: commands/core/upgrade.go:70\nmsgid \"platform %s not found\"\nmsgstr \"platform %s not found\"\n\n#: commands/core/upgrade.go:31\nmsgid \"platform already at latest version\"\nmsgstr \"platform already at latest version\"\n\n#: commands/core/uninstall.go:43\nmsgid \"platform not found: %s\"\nmsgstr \"platform not found: %s\"\n\n#: arduino/cores/packagemanager/install_uninstall.go:65\n#: arduino/cores/packagemanager/install_uninstall.go:108\n#: arduino/cores/packagemanager/loader.go:364\n#: commands/compile/compile.go:128\nmsgid \"platform not installed\"\nmsgstr \"platform not installed\"\n\n#: commands/core/uninstall.go:48\nmsgid \"platform not installed: %s\"\nmsgstr \"platform not installed: %s\"\n\n#: cli/compile/compile.go:120\nmsgid \"please use --build-property instead.\"\nmsgstr \"please use --build-property instead.\"\n\n#: cli/board/attach.go:36\nmsgid \"port\"\nmsgstr \"port\"\n\n#: commands/upload/upload.go:155\nmsgid \"programmer '%s' not available\"\nmsgstr \"programmer '%s' not available\"\n\n#: commands/debug/debug_info.go:114\nmsgid \"programmer '%s' not found\"\nmsgstr \"programmer '%s' not found\"\n\n#: commands/upload/upload.go:83\nmsgid \"programmer not specified\"\nmsgstr \"programmer not specified\"\n\n#: commands/upload/upload.go:380\nmsgid \"programming error: %s\"\nmsgstr \"programming error: %s\"\n\n#: arduino/discovery/discovery.go:231\nmsgid \"protocol version not supported: requested 1, got %d\"\nmsgstr \"protocol version not supported: requested 1, got %d\"\n\n#: arduino/cores/packagemanager/loader.go:77\nmsgid \"reading %[1]s directory: %[2]s\"\nmsgstr \"reading %[1]s directory: %[2]s\"\n\n#: arduino/cores/packagemanager/loader.go:569\nmsgid \"reading %[1]s: %[2]s\"\nmsgstr \"reading %[1]s: %[2]s\"\n\n#: commands/compile/compile.go:263\nmsgid \"reading build directory: %s\"\nmsgstr \"reading build directory: %s\"\n\n#: arduino/cores/packagemanager/loader.go:266\n#: arduino/libraries/librariesmanager/librariesmanager.go:196\nmsgid \"reading dir %[1]s: %[2]s\"\nmsgstr \"reading dir %[1]s: %[2]s\"\n\n#: arduino/cores/packagemanager/loader.go:161\n#: arduino/cores/packagemanager/loader.go:477\nmsgid \"reading directory %[1]s: %[2]s\"\nmsgstr \"reading directory %[1]s: %[2]s\"\n\n#: arduino/builder/sketch.go:76\nmsgid \"reading file %[1]s: %[2]s\"\nmsgstr \"reading file %[1]s: %[2]s\"\n\n#: arduino/sketch/sketch.go:228\nmsgid \"reading files: %v\"\nmsgstr \"reading files: %v\"\n\n#: inventory/inventory.go:57\nmsgid \"reading inventory file: %w\"\nmsgstr \"reading inventory file: %w\"\n\n#: arduino/libraries/librariesresolver/cpp.go:60\nmsgid \"reading lib headers: %s\"\nmsgstr \"reading lib headers: %s\"\n\n#: arduino/libraries/libraries.go:234\nmsgid \"reading lib src dir: %s\"\nmsgstr \"reading lib src dir: %s\"\n\n#: arduino/libraries/librariesindex/json.go:63\nmsgid \"reading library_index.json: %s\"\nmsgstr \"reading library_index.json: %s\"\n\n#: arduino/resources/install.go:118\nmsgid \"reading package root dir: %s\"\nmsgstr \"reading package root dir: %s\"\n\n#: arduino/sketch/sketch.go:187\nmsgid \"reading sketch metadata %[1]s: %[2]s\"\nmsgstr \"reading sketch metadata %[1]s: %[2]s\"\n\n#: commands/upload/upload.go:395\nmsgid \"recipe not found '%s'\"\nmsgstr \"recipe not found '%s'\"\n\n#: arduino/cores/packagemanager/package_manager.go:326\nmsgid \"release %[1]s not found for tool %[2]s\"\nmsgstr \"release %[1]s not found for tool %[2]s\"\n\n#: arduino/cores/status.go:82\n#: arduino/cores/status.go:106\nmsgid \"release cannot be nil\"\nmsgstr \"release cannot be nil\"\n\n#: arduino/cores/status.go:183\nmsgid \"release not found\"\nmsgstr \"release not found\"\n\n#: arduino/resources/helpers.go:59\nmsgid \"removing corrupted archive file: %s\"\nmsgstr \"removing corrupted archive file: %s\"\n\n#: arduino/libraries/librariesmanager/install.go:89\nmsgid \"removing lib directory: %s\"\nmsgstr \"removing lib directory: %s\"\n\n#: arduino/cores/packagemanager/install_uninstall.go:117\nmsgid \"removing platform files: %s\"\nmsgstr \"removing platform files: %s\"\n\n#: arduino/cores/packagemanager/install_uninstall.go:169\nmsgid \"removing tool files: %s\"\nmsgstr \"removing tool files: %s\"\n\n#: arduino/cores/packagemanager/download.go:84\nmsgid \"required version %[1]s not found for platform %[2]s\"\nmsgstr \"required version %[1]s not found for platform %[2]s\"\n\n#: commands/lib/install.go:82\n#: commands/lib/upgrade.go:38\nmsgid \"rescanning libraries: %s\"\nmsgstr \"rescanning libraries: %s\"\n\n#: arduino/security/signatures.go:72\nmsgid \"retrieving Arduino public keys: %s\"\nmsgstr \"retrieving Arduino public keys: %s\"\n\n#: commands/upload/upload.go:283\nmsgid \"retrieving build artifacts: %s\"\nmsgstr \"retrieving build artifacts: %s\"\n\n#: commands/instances.go:510\nmsgid \"saving downloaded index %[1]s: %[2]s\"\nmsgstr \"saving downloaded index %[1]s: %[2]s\"\n\n#: commands/instances.go:514\nmsgid \"saving downloaded index signature: %s\"\nmsgstr \"saving downloaded index signature: %s\"\n\n#: arduino/libraries/loader.go:109\n#: arduino/libraries/loader.go:140\nmsgid \"scanning examples: %s\"\nmsgstr \"scanning examples: %s\"\n\n#: arduino/cores/packagemanager/loader.go:555\nmsgid \"searching for builtin_tools_versions.txt in %[1]s: %[2]s\"\nmsgstr \"searching for builtin_tools_versions.txt in %[1]s: %[2]s\"\n\n#: arduino/resources/install.go:73\nmsgid \"searching package root dir: %s\"\nmsgstr \"searching package root dir: %s\"\n\n#: arduino/serialutils/serialutils.go:43\nmsgid \"setting DTR to OFF\"\nmsgstr \"setting DTR to OFF\"\n\n#: commands/instances.go:494\nmsgid \"signature verification error: %s\"\nmsgstr \"signature verification error: %s\"\n\n#: cli/board/attach.go:36\n#: cli/sketch/archive.go:38\nmsgid \"sketchPath\"\nmsgstr \"sketchPath\"\n\n#: arduino/cores/packagemanager/loader.go:427\nmsgid \"skipping loading of boards %s: malformed custom board options\"\nmsgstr \"skipping loading of boards %s: malformed custom board options\"\n\n#: legacy/builder/utils/utils.go:463\nmsgid \"source is not a directory\"\nmsgstr \"source is not a directory\"\n\n#: commands/bundled_tools_serial_discovery.go:129\n#: commands/bundled_tools_serial_discovery.go:133\n#: commands/bundled_tools_serial_discovery.go:157\n#: commands/bundled_tools_serial_discovery.go:161\nmsgid \"starting discovery: %v\"\nmsgstr \"starting discovery: %v\"\n\n#: commands/bundled_tools_serial_discovery.go:165\nmsgid \"starting sync: %v\"\nmsgstr \"starting sync: %v\"\n\n#: arduino/resources/checksums.go:119\nmsgid \"testing archive checksum: %s\"\nmsgstr \"testing archive checksum: %s\"\n\n#: arduino/resources/checksums.go:112\nmsgid \"testing archive size: %s\"\nmsgstr \"testing archive size: %s\"\n\n#: arduino/resources/checksums.go:106\nmsgid \"testing if archive is cached: %s\"\nmsgstr \"testing if archive is cached: %s\"\n\n#: arduino/resources/install.go:37\nmsgid \"testing local archive integrity: %s\"\nmsgstr \"testing local archive integrity: %s\"\n\n#: legacy/builder/phases/sizer.go:111\nmsgid \"text section exceeds available space in board\"\nmsgstr \"text section exceeds available space in board\"\n\n#: arduino/libraries/librariesmanager/librariesmanager.go:65\nmsgid \"the library name is different from the set (%[1]s != %[2]s)\"\nmsgstr \"the library name is different from the set (%[1]s != %[2]s)\"\n\n#: commands/board/list.go:73\nmsgid \"the server responded with status %s\"\nmsgstr \"the server responded with status %s\"\n\n#: cli/core/download.go:40\nmsgid \"to download the latest version of Arduino SAMD core.\\n\"\n\"\"\nmsgstr \"to download the latest version of Arduino SAMD core.\\n\"\n\"\"\n\n#: arduino/cores/packagemanager/install_uninstall.go:165\nmsgid \"tool %s is not managed by package manager\"\nmsgstr \"tool %s is not managed by package manager\"\n\n#: commands/core/download.go:84\nmsgid \"tool %s not available for the current OS\"\nmsgstr \"tool %s not available for the current OS\"\n\n#: arduino/cores/status.go:92\n#: arduino/cores/status.go:117\nmsgid \"tool %s not found\"\nmsgstr \"tool %s not found\"\n\n#: arduino/cores/packagemanager/package_manager.go:276\nmsgid \"tool '%[1]s' not found in package '%[2]s'\"\nmsgstr \"tool '%[1]s' not found in package '%[2]s'\"\n\n#: arduino/cores/packagemanager/download.go:114\nmsgid \"tool not available for your OS\"\nmsgstr \"tool not available for your OS\"\n\n#: arduino/cores/status.go:171\nmsgid \"tool not found\"\nmsgstr \"tool not found\"\n\n#: arduino/cores/packagemanager/install_uninstall.go:160\nmsgid \"tool not installed\"\nmsgstr \"tool not installed\"\n\n#: arduino/cores/packagemanager/package_manager.go:477\nmsgid \"tool release not found: %s\"\nmsgstr \"tool release not found: %s\"\n\n#: arduino/cores/status.go:96\nmsgid \"tool version %s not found\"\nmsgstr \"tool version %s not found\"\n\n#: commands/lib/install.go:54\nmsgid \"two different versions of the library %[1]s are required: %[2]s and %[3]s\"\nmsgstr \"two different versions of the library %[1]s are required: %[2]s and %[3]s\"\n\n#: arduino/builder/sketch.go:69\n#: arduino/builder/sketch.go:117\nmsgid \"unable to compute relative path to the sketch for the item\"\nmsgstr \"unable to compute relative path to the sketch for the item\"\n\n#: arduino/builder/sketch.go:49\nmsgid \"unable to create a folder to save the sketch\"\nmsgstr \"unable to create a folder to save the sketch\"\n\n#: arduino/builder/sketch.go:111\nmsgid \"unable to create a folder to save the sketch files\"\nmsgstr \"unable to create a folder to save the sketch files\"\n\n#: arduino/builder/sketch.go:123\nmsgid \"unable to create the folder containing the item\"\nmsgstr \"unable to create the folder containing the item\"\n\n#: commands/core/list.go:33\nmsgid \"unable to find an instance with ID: %d\"\nmsgstr \"unable to find an instance with ID: %d\"\n\n#: cli/config/dump.go:53\nmsgid \"unable to marshal config to YAML: %v\"\nmsgstr \"unable to marshal config to YAML: %v\"\n\n#: arduino/builder/sketch.go:161\nmsgid \"unable to read contents of the destination item\"\nmsgstr \"unable to read contents of the destination item\"\n\n#: arduino/builder/sketch.go:134\nmsgid \"unable to read contents of the source item\"\nmsgstr \"unable to read contents of the source item\"\n\n#: arduino/builder/sketch.go:55\nmsgid \"unable to save the sketch on disk\"\nmsgstr \"unable to save the sketch on disk\"\n\n#: arduino/builder/sketch.go:144\nmsgid \"unable to write to destination file\"\nmsgstr \"unable to write to destination file\"\n\n#: arduino/cores/packagemanager/package_manager.go:161\nmsgid \"unknown package %s\"\nmsgstr \"unknown package %s\"\n\n#: arduino/cores/packagemanager/package_manager.go:168\nmsgid \"unknown platform %s:%s\"\nmsgstr \"unknown platform %s:%s\"\n\n#: arduino/sketch/sketch.go:141\nmsgid \"unknown sketch file extension '%s'\"\nmsgstr \"unknown sketch file extension '%s'\"\n\n#: commands/debug/debug.go:173\nmsgid \"unsupported gdb server '%s'\"\nmsgstr \"unsupported gdb server '%s'\"\n\n#: arduino/resources/checksums.go:62\nmsgid \"unsupported hash algorithm: %s\"\nmsgstr \"unsupported hash algorithm: %s\"\n\n#: commands/debug/debug.go:134\nmsgid \"unsupported toolchain '%s'\"\nmsgstr \"unsupported toolchain '%s'\"\n\n#: commands/instances.go:378\nmsgid \"unzipping library_index.json.gz\"\nmsgstr \"unzipping library_index.json.gz\"\n\n#: cli/core/upgrade.go:42\nmsgid \"upgrade arduino:samd to the latest version\"\nmsgstr \"upgrade arduino:samd to the latest version\"\n\n#: commands/core/upgrade.go:64\nmsgid \"upgrade doesn't accept parameters with version\"\nmsgstr \"upgrade doesn't accept parameters with version\"\n\n#: cli/core/upgrade.go:40\nmsgid \"upgrade everything to the latest version\"\nmsgstr \"upgrade everything to the latest version\"\n\n#: commands/core/install.go:156\nmsgid \"upgrading platform: %s\"\nmsgstr \"upgrading platform: %s\"\n\n#: commands/upload/upload.go:384\n#: commands/upload/upload.go:430\nmsgid \"uploading error: %s\"\nmsgstr \"uploading error: %s\"\n\n#: commands/instances.go:383\nmsgid \"verifying signature\"\nmsgstr \"verifying signature\"\n\n#: commands/instances.go:392\nmsgid \"writing library_index.json\"\nmsgstr \"writing library_index.json\"\n\n#: commands/instances.go:395\nmsgid \"writing library_index.json.sig\"\nmsgstr \"writing library_index.json.sig\"\n\n#: arduino/sketch/sketch.go:211\nmsgid \"writing sketch metadata %[1]s: %[2]s\"\nmsgstr \"writing sketch metadata %[1]s: %[2]s\"\n\n#: commands/board/list.go:89\nmsgid \"wrong format in server response\"\nmsgstr \"wrong format in server response\"\n\n#: legacy/builder/constants/constants.go:100\nmsgid \"{0} invalid\"\nmsgstr \"{0} invalid\"\n\n#: legacy/builder/constants/constants.go:102\nmsgid \"{0} is not a valid fully qualified board name. Required format is targetPackageName:targetPlatformName:targetBoardName.\"\nmsgstr \"{0} is not a valid fully qualified board name. Required format is targetPackageName:targetPlatformName:targetBoardName.\"\n\n#: legacy/builder/builder_utils/utils.go:323\n#: legacy/builder/builder_utils/utils.go:329\n#: legacy/builder/builder_utils/utils.go:393\nmsgid \"{0} newer than {1}\"\nmsgstr \"{0} newer than {1}\"\n\n#: legacy/builder/constants/constants.go:114\nmsgid \"{0}: Unknown package\"\nmsgstr \"{0}: Unknown package\"\n\n"), } file4 := &embedded.EmbeddedFile{ Filename: "it_IT.po", - FileModTime: time.Unix(1615910215, 0), + FileModTime: time.Unix(1614542000, 0), Content: string("# \n# Translators:\n# Cristian Maglie , 2020\n# \nmsgid \"\"\nmsgstr \"\"\n\"Last-Translator: Cristian Maglie , 2020\\n\"\n\"Language-Team: Italian (Italy) (https://www.transifex.com/arduino-1/teams/108174/it_IT/)\\n\"\n\"Language: it_IT\\n\"\n\"Plural-Forms: nplurals=2; plural=(n != 1);\\n\"\n\n#: cli/usage.go:31\nmsgid \"Additional help topics:\"\nmsgstr \"Informazioni aggiuntive:\"\n\n#: cli/usage.go:26\nmsgid \"Aliases:\"\nmsgstr \"Alias:\"\n\n#: cli/usage.go:28\nmsgid \"Available Commands:\"\nmsgstr \"Comandi disponibili:\"\n\n#: cli/board/details.go:98\nmsgid \"Board name:\"\nmsgstr \"\"\n\n#: cli/board/details.go:100\nmsgid \"Board version:\"\nmsgstr \"\"\n\n#: cli/board/details.go:141\nmsgid \"Checksum:\"\nmsgstr \"\"\n\n#: cli/board/details.go:55 cli/board/details.go:65\nmsgid \"Error getting board details: %v\"\nmsgstr \"\"\n\n#: cli/usage.go:27\nmsgid \"Examples:\"\nmsgstr \"Esempi:\"\n\n#: cli/board/details.go:139\nmsgid \"File:\"\nmsgstr \"\"\n\n#: cli/usage.go:29\nmsgid \"Flags:\"\nmsgstr \"\"\n\n#: cli/usage.go:30\nmsgid \"Global Flags:\"\nmsgstr \"\"\n\n#: cli/board/details.go:111\nmsgid \"Identification properties:\"\nmsgstr \"\"\n\n#: cli/board/details.go:138\nmsgid \"OS:\"\nmsgstr \"\"\n\n#: cli/board/details.go:104\nmsgid \"Official Arduino board:\"\nmsgstr \"\"\n\n#: cli/board/details.go:150\nmsgid \"Option:\"\nmsgstr \"\"\n\n#: cli/board/details.go:120\nmsgid \"Package URL:\"\nmsgstr \"\"\n\n#: cli/board/details.go:119\nmsgid \"Package maintainer:\"\nmsgstr \"\"\n\n#: cli/board/details.go:118\nmsgid \"Package name:\"\nmsgstr \"\"\n\n#: cli/board/details.go:122\nmsgid \"Package online help:\"\nmsgstr \"\"\n\n#: cli/board/details.go:121\nmsgid \"Package website:\"\nmsgstr \"\"\n\n#: cli/board/details.go:128\nmsgid \"Platform URL:\"\nmsgstr \"\"\n\n#: cli/board/details.go:127\nmsgid \"Platform architecture:\"\nmsgstr \"\"\n\n#: cli/board/details.go:126\nmsgid \"Platform category:\"\nmsgstr \"\"\n\n#: cli/board/details.go:131\nmsgid \"Platform checksum:\"\nmsgstr \"\"\n\n#: cli/board/details.go:129\nmsgid \"Platform file name:\"\nmsgstr \"\"\n\n#: cli/board/details.go:125\nmsgid \"Platform name:\"\nmsgstr \"\"\n\n#: cli/board/details.go:130\nmsgid \"Platform size (bytes):\"\nmsgstr \"\"\n\n#: cli/board/details.go:40\nmsgid \"Print details about a board.\"\nmsgstr \"\"\n\n#: cli/board/details.go:135\nmsgid \"Required tool:\"\nmsgstr \"\"\n\n#: cli/board/details.go:47\nmsgid \"Show full board details\"\nmsgstr \"\"\n\n#: cli/board/details.go:41\nmsgid \"\"\n\"Show information about a board, in particular if the board has options to be\"\n\" specified in the FQBN.\"\nmsgstr \"\"\n\n#: cli/board/details.go:140\nmsgid \"Size (bytes):\"\nmsgstr \"\"\n\n#: cli/usage.go:25\nmsgid \"Usage:\"\nmsgstr \"\"\n\n#: cli/usage.go:32\nmsgid \"Use %s for more information about a command.\"\nmsgstr \"\"\n"), } file5 := &embedded.EmbeddedFile{ Filename: "pt_BR.po", - FileModTime: time.Unix(1615910215, 0), + FileModTime: time.Unix(1614542000, 0), Content: string("# \n# Translators:\n# Henrique Diniz , 2020\n# \nmsgid \"\"\nmsgstr \"\"\n\"Last-Translator: Henrique Diniz , 2020\\n\"\n\"Language-Team: Portuguese (Brazil) (https://www.transifex.com/arduino-1/teams/108174/pt_BR/)\\n\"\n\"Language: pt_BR\\n\"\n\"Plural-Forms: nplurals=2; plural=(n > 1);\\n\"\n\n#: cli/usage.go:31\nmsgid \"Additional help topics:\"\nmsgstr \"\"\n\n#: cli/usage.go:26\nmsgid \"Aliases:\"\nmsgstr \"\"\n\n#: cli/usage.go:28\nmsgid \"Available Commands:\"\nmsgstr \"\"\n\n#: cli/board/details.go:98\nmsgid \"Board name:\"\nmsgstr \"\"\n\n#: cli/board/details.go:100\nmsgid \"Board version:\"\nmsgstr \"\"\n\n#: cli/board/details.go:141\nmsgid \"Checksum:\"\nmsgstr \"\"\n\n#: cli/board/details.go:55 cli/board/details.go:65\nmsgid \"Error getting board details: %v\"\nmsgstr \"\"\n\n#: cli/usage.go:27\nmsgid \"Examples:\"\nmsgstr \"\"\n\n#: cli/board/details.go:139\nmsgid \"File:\"\nmsgstr \"\"\n\n#: cli/usage.go:29\nmsgid \"Flags:\"\nmsgstr \"\"\n\n#: cli/usage.go:30\nmsgid \"Global Flags:\"\nmsgstr \"\"\n\n#: cli/board/details.go:111\nmsgid \"Identification properties:\"\nmsgstr \"\"\n\n#: cli/board/details.go:138\nmsgid \"OS:\"\nmsgstr \"\"\n\n#: cli/board/details.go:104\nmsgid \"Official Arduino board:\"\nmsgstr \"\"\n\n#: cli/board/details.go:150\nmsgid \"Option:\"\nmsgstr \"\"\n\n#: cli/board/details.go:120\nmsgid \"Package URL:\"\nmsgstr \"\"\n\n#: cli/board/details.go:119\nmsgid \"Package maintainer:\"\nmsgstr \"\"\n\n#: cli/board/details.go:118\nmsgid \"Package name:\"\nmsgstr \"\"\n\n#: cli/board/details.go:122\nmsgid \"Package online help:\"\nmsgstr \"\"\n\n#: cli/board/details.go:121\nmsgid \"Package website:\"\nmsgstr \"\"\n\n#: cli/board/details.go:128\nmsgid \"Platform URL:\"\nmsgstr \"\"\n\n#: cli/board/details.go:127\nmsgid \"Platform architecture:\"\nmsgstr \"\"\n\n#: cli/board/details.go:126\nmsgid \"Platform category:\"\nmsgstr \"\"\n\n#: cli/board/details.go:131\nmsgid \"Platform checksum:\"\nmsgstr \"\"\n\n#: cli/board/details.go:129\nmsgid \"Platform file name:\"\nmsgstr \"\"\n\n#: cli/board/details.go:125\nmsgid \"Platform name:\"\nmsgstr \"\"\n\n#: cli/board/details.go:130\nmsgid \"Platform size (bytes):\"\nmsgstr \"\"\n\n#: cli/board/details.go:40\nmsgid \"Print details about a board.\"\nmsgstr \"\"\n\n#: cli/board/details.go:135\nmsgid \"Required tool:\"\nmsgstr \"\"\n\n#: cli/board/details.go:47\nmsgid \"Show full board details\"\nmsgstr \"\"\n\n#: cli/board/details.go:41\nmsgid \"\"\n\"Show information about a board, in particular if the board has options to be\"\n\" specified in the FQBN.\"\nmsgstr \"\"\n\n#: cli/board/details.go:140\nmsgid \"Size (bytes):\"\nmsgstr \"\"\n\n#: cli/usage.go:25\nmsgid \"Usage:\"\nmsgstr \"\"\n\n#: cli/usage.go:32\nmsgid \"Use %s for more information about a command.\"\nmsgstr \"Use %s para mais informações sobre um comando.\"\n"), } @@ -38,7 +38,7 @@ func init() { // define dirs dir1 := &embedded.EmbeddedDir{ Filename: "", - DirModTime: time.Unix(1624438332, 0), + DirModTime: time.Unix(1628163125, 0), ChildFiles: []*embedded.EmbeddedFile{ file2, // ".gitkeep" file3, // "en.po" @@ -54,7 +54,7 @@ func init() { // register embeddedBox embedded.RegisterEmbeddedBox(`./data`, &embedded.EmbeddedBox{ Name: `./data`, - Time: time.Unix(1624438332, 0), + Time: time.Unix(1628163125, 0), Dirs: map[string]*embedded.EmbeddedDir{ "": dir1, }, diff --git a/inventory/inventory.go b/inventory/inventory.go index d0fef352a5e..e3fc50b9860 100644 --- a/inventory/inventory.go +++ b/inventory/inventory.go @@ -20,6 +20,7 @@ import ( "os" "path/filepath" + "github.com/arduino/arduino-cli/i18n" "github.com/gofrs/uuid" "github.com/spf13/viper" ) @@ -32,6 +33,7 @@ var ( Type = "yaml" // Name is the inventory file Name with Type as extension Name = "inventory" + "." + Type + tr = i18n.Tr ) // Init configures the Read Only config storage @@ -52,7 +54,7 @@ func Init(configPath string) error { return err } } else { - return fmt.Errorf("reading inventory file: %w", err) + return fmt.Errorf(tr("reading inventory file: %w"), err) } } @@ -62,13 +64,13 @@ func Init(configPath string) error { func generateInstallationData() error { installationID, err := uuid.NewV4() if err != nil { - return fmt.Errorf("generating installation.id: %w", err) + return fmt.Errorf(tr("generating installation.id: %w"), err) } Store.Set("installation.id", installationID.String()) installationSecret, err := uuid.NewV4() if err != nil { - return fmt.Errorf("generating installation.secret: %w", err) + return fmt.Errorf(tr("generating installation.secret: %w"), err) } Store.Set("installation.secret", installationSecret.String()) return nil @@ -80,13 +82,13 @@ func writeStore(configFilePath string) error { // Create config dir if not present, // MkdirAll will retrun no error if the path already exists if err := os.MkdirAll(configPath, os.FileMode(0755)); err != nil { - return fmt.Errorf("invalid path creating config dir: %s error: %w", configPath, err) + return fmt.Errorf(tr("invalid path creating config dir: %[1]s error: %[2]w"), configPath, err) } // Create file if not present err := Store.WriteConfigAs(configFilePath) if err != nil { - return fmt.Errorf("invalid path writing inventory file: %s error: %w", configFilePath, err) + return fmt.Errorf(tr("invalid path writing inventory file: %[1]s error: %[2]w"), configFilePath, err) } return nil diff --git a/legacy/builder/builder.go b/legacy/builder/builder.go index 1d49a70a210..92b75d6abec 100644 --- a/legacy/builder/builder.go +++ b/legacy/builder/builder.go @@ -22,6 +22,7 @@ import ( "time" "github.com/arduino/arduino-cli/arduino/sketch" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/legacy/builder/builder_utils" "github.com/arduino/arduino-cli/legacy/builder/constants" "github.com/arduino/arduino-cli/legacy/builder/phases" @@ -30,6 +31,8 @@ import ( "github.com/pkg/errors" ) +var tr = i18n.Tr + var MAIN_FILE_VALID_EXTENSIONS = map[string]bool{".ino": true, ".pde": true} var ADDITIONAL_FILE_VALID_EXTENSIONS = map[string]bool{".h": true, ".c": true, ".hpp": true, ".hh": true, ".cpp": true, ".S": true} var ADDITIONAL_FILE_VALID_EXTENSIONS_NO_HEADERS = map[string]bool{".c": true, ".cpp": true, ".S": true} @@ -56,31 +59,31 @@ func (s *Builder) Run(ctx *types.Context) error { &ContainerMergeCopySketchFiles{}, - utils.LogIfVerbose(constants.LOG_LEVEL_INFO, "Detecting libraries used..."), + utils.LogIfVerbose(constants.LOG_LEVEL_INFO, tr("Detecting libraries used...")), &ContainerFindIncludes{}, &WarnAboutArchIncompatibleLibraries{}, - utils.LogIfVerbose(constants.LOG_LEVEL_INFO, "Generating function prototypes..."), + utils.LogIfVerbose(constants.LOG_LEVEL_INFO, tr("Generating function prototypes...")), &PreprocessSketch{}, - utils.LogIfVerbose(constants.LOG_LEVEL_INFO, "Compiling sketch..."), + utils.LogIfVerbose(constants.LOG_LEVEL_INFO, tr("Compiling sketch...")), &RecipeByPrefixSuffixRunner{Prefix: constants.HOOKS_SKETCH_PREBUILD, Suffix: constants.HOOKS_PATTERN_SUFFIX}, &phases.SketchBuilder{}, &RecipeByPrefixSuffixRunner{Prefix: constants.HOOKS_SKETCH_POSTBUILD, Suffix: constants.HOOKS_PATTERN_SUFFIX}, - utils.LogIfVerbose(constants.LOG_LEVEL_INFO, "Compiling libraries..."), + utils.LogIfVerbose(constants.LOG_LEVEL_INFO, tr("Compiling libraries...")), &RecipeByPrefixSuffixRunner{Prefix: constants.HOOKS_LIBRARIES_PREBUILD, Suffix: constants.HOOKS_PATTERN_SUFFIX}, &UnusedCompiledLibrariesRemover{}, &phases.LibrariesBuilder{}, &RecipeByPrefixSuffixRunner{Prefix: constants.HOOKS_LIBRARIES_POSTBUILD, Suffix: constants.HOOKS_PATTERN_SUFFIX}, - utils.LogIfVerbose(constants.LOG_LEVEL_INFO, "Compiling core..."), + utils.LogIfVerbose(constants.LOG_LEVEL_INFO, tr("Compiling core...")), &RecipeByPrefixSuffixRunner{Prefix: constants.HOOKS_CORE_PREBUILD, Suffix: constants.HOOKS_PATTERN_SUFFIX}, &phases.CoreBuilder{}, &RecipeByPrefixSuffixRunner{Prefix: constants.HOOKS_CORE_POSTBUILD, Suffix: constants.HOOKS_PATTERN_SUFFIX}, - utils.LogIfVerbose(constants.LOG_LEVEL_INFO, "Linking everything together..."), + utils.LogIfVerbose(constants.LOG_LEVEL_INFO, tr("Linking everything together...")), &RecipeByPrefixSuffixRunner{Prefix: constants.HOOKS_LINKING_PRELINK, Suffix: constants.HOOKS_PATTERN_SUFFIX}, &phases.Linker{}, &RecipeByPrefixSuffixRunner{Prefix: constants.HOOKS_LINKING_POSTLINK, Suffix: constants.HOOKS_PATTERN_SUFFIX}, diff --git a/legacy/builder/builder_utils/utils.go b/legacy/builder/builder_utils/utils.go index 5d568b91b67..37a8d1c409e 100644 --- a/legacy/builder/builder_utils/utils.go +++ b/legacy/builder/builder_utils/utils.go @@ -24,6 +24,7 @@ import ( "strings" "sync" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/legacy/builder/constants" "github.com/arduino/arduino-cli/legacy/builder/types" "github.com/arduino/arduino-cli/legacy/builder/utils" @@ -32,6 +33,8 @@ import ( "github.com/pkg/errors" ) +var tr = i18n.Tr + func PrintProgressIfProgressEnabledAndMachineLogger(ctx *types.Context) { if !ctx.Progress.PrintEnabled { @@ -263,7 +266,7 @@ func compileFileWithRecipe(ctx *types.Context, sourcePath *paths.Path, source *p if objIsUpToDate { logger.Println(constants.LOG_LEVEL_INFO, constants.MSG_USING_PREVIOUS_COMPILED_FILE, objectFile) } else { - logger.Println("info", "Skipping compile of: {0}", objectFile) + logger.Println("info", tr("Skipping compile of: {0}"), objectFile) } } @@ -274,11 +277,11 @@ func ObjFileIsUpToDate(ctx *types.Context, sourceFile, objectFile, dependencyFil logger := ctx.GetLogger() debugLevel := ctx.DebugLevel if debugLevel >= 20 { - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, "Checking previous results for {0} (result = {1}, dep = {2})", sourceFile, objectFile, dependencyFile) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, tr("Checking previous results for {0} (result = {1}, dep = {2})"), sourceFile, objectFile, dependencyFile) } if objectFile == nil || dependencyFile == nil { if debugLevel >= 20 { - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, "Not found: nil") + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, tr("Not found: nil")) } return false, nil } @@ -294,7 +297,7 @@ func ObjFileIsUpToDate(ctx *types.Context, sourceFile, objectFile, dependencyFil if err != nil { if os.IsNotExist(err) { if debugLevel >= 20 { - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, "Not found: {0}", objectFile) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, tr("Not found: {0}"), objectFile) } return false, nil } else { @@ -307,7 +310,7 @@ func ObjFileIsUpToDate(ctx *types.Context, sourceFile, objectFile, dependencyFil if err != nil { if os.IsNotExist(err) { if debugLevel >= 20 { - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, "Not found: {0}", dependencyFile) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, tr("Not found: {0}"), dependencyFile) } return false, nil } else { @@ -317,13 +320,13 @@ func ObjFileIsUpToDate(ctx *types.Context, sourceFile, objectFile, dependencyFil if sourceFileStat.ModTime().After(objectFileStat.ModTime()) { if debugLevel >= 20 { - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, "{0} newer than {1}", sourceFile, objectFile) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, tr("{0} newer than {1}"), sourceFile, objectFile) } return false, nil } if sourceFileStat.ModTime().After(dependencyFileStat.ModTime()) { if debugLevel >= 20 { - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, "{0} newer than {1}", sourceFile, dependencyFile) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, tr("{0} newer than {1}"), sourceFile, dependencyFile) } return false, nil } @@ -345,14 +348,14 @@ func ObjFileIsUpToDate(ctx *types.Context, sourceFile, objectFile, dependencyFil firstRow := rows[0] if !strings.HasSuffix(firstRow, ":") { if debugLevel >= 20 { - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, "No colon in first line of depfile") + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, tr("No colon in first line of depfile")) } return false, nil } objFileInDepFile := firstRow[:len(firstRow)-1] if objFileInDepFile != objectFile.String() { if debugLevel >= 20 { - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, "Depfile is about different file: {0}", objFileInDepFile) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, tr("Depfile is about different file: {0}"), objFileInDepFile) } return false, nil } @@ -374,20 +377,20 @@ func ObjFileIsUpToDate(ctx *types.Context, sourceFile, objectFile, dependencyFil // There is probably a parsing error of the dep file // Ignore the error and trigger a full rebuild anyway if debugLevel >= 20 { - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, "Failed to read: {0}", row) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, tr("Failed to read: {0}"), row) logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, err.Error()) } return false, nil } if os.IsNotExist(err) { if debugLevel >= 20 { - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, "Not found: {0}", row) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, tr("Not found: {0}"), row) } return false, nil } if depStat.ModTime().After(objectFileStat.ModTime()) { if debugLevel >= 20 { - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, "{0} newer than {1}", row, objectFile) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, tr("{0} newer than {1}"), row, objectFile) } return false, nil } @@ -470,7 +473,7 @@ func ArchiveCompiledFiles(ctx *types.Context, buildPath *paths.Path, archiveFile if ctx.OnlyUpdateCompilationDatabase { if ctx.Verbose { - logger.Println("info", "Skipping archive creation of: {0}", archiveFilePath) + logger.Println("info", tr("Skipping archive creation of: {0}"), archiveFilePath) } return archiveFilePath, nil } @@ -524,7 +527,7 @@ const COMMANDLINE_LIMIT = 30000 func PrepareCommandForRecipe(buildProperties *properties.Map, recipe string, removeUnsetProperties bool) (*exec.Cmd, error) { pattern := buildProperties.Get(recipe) if pattern == "" { - return nil, errors.Errorf("%s pattern is missing", recipe) + return nil, errors.Errorf(tr("%s pattern is missing"), recipe) } commandLine := buildProperties.ExpandPropsInString(pattern) diff --git a/legacy/builder/constants/constants.go b/legacy/builder/constants/constants.go index 7e35760adb3..7cc215c5524 100644 --- a/legacy/builder/constants/constants.go +++ b/legacy/builder/constants/constants.go @@ -16,6 +16,14 @@ package constants +import ( + "fmt" + + "github.com/arduino/arduino-cli/i18n" +) + +var tr = i18n.Tr + const BUILD_OPTIONS_FILE = "build.options.json" const BUILD_PROPERTIES_ARCHIVE_FILE = "archive_file" const BUILD_PROPERTIES_ARCHIVE_FILE_PATH = "archive_file_path" @@ -80,53 +88,55 @@ const LOG_LEVEL_DEBUG = "debug" const LOG_LEVEL_ERROR = "error" const LOG_LEVEL_INFO = "info" const LOG_LEVEL_WARN = "warn" -const MSG_ARCH_FOLDER_NOT_SUPPORTED = "'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information" -const MSG_ARCHIVING_CORE_CACHE = "Archiving built core (caching) in: {0}" -const MSG_ERROR_ARCHIVING_CORE_CACHE = "Error archiving built core (caching) in {0}: {1}" -const MSG_CORE_CACHE_UNAVAILABLE = "Unable to cache built core, please tell {0} maintainers to follow https://arduino.github.io/arduino-cli/latest/platform-specification/#recipes-to-build-the-corea-archive-file" -const MSG_BOARD_UNKNOWN = "Board {0} (platform {1}, package {2}) is unknown" -const MSG_BOOTLOADER_FILE_MISSING = "Bootloader file specified but missing: {0}" -const MSG_REBUILD_ALL = ", rebuilding all" -const MSG_BUILD_OPTIONS_CHANGED = "Build options changed" -const MSG_BUILD_OPTIONS_INVALID = "{0} invalid" -const MSG_CANT_FIND_SKETCH_IN_PATH = "Unable to find {0} in {1}" -const MSG_FQBN_INVALID = "{0} is not a valid fully qualified board name. Required format is targetPackageName:targetPlatformName:targetBoardName." -const MSG_SKIP_PRECOMPILED_LIBRARY = "Skipping dependencies detection for precompiled library {0}" -const MSG_FIND_INCLUDES_FAILED = "Error while detecting libraries included by {0}" -const MSG_LIB_LEGACY = "(legacy)" -const MSG_LIBRARIES_MULTIPLE_LIBS_FOUND_FOR = "Multiple libraries were found for \"{0}\"" -const MSG_LIBRARIES_NOT_USED = " Not used: {0}" -const MSG_LIBRARIES_USED = " Used: {0}" -const MSG_LIBRARY_CAN_USE_SRC_AND_UTILITY_FOLDERS = "Library can't use both 'src' and 'utility' folders. Double check {0}" -const MSG_LIBRARY_INCOMPATIBLE_ARCH = "WARNING: library {0} claims to run on {1} architecture(s) and may be incompatible with your current board which runs on {2} architecture(s)." -const MSG_LOOKING_FOR_RECIPES = "Looking for recipes like {0}*{1}" -const MSG_MISSING_BUILD_BOARD = "Warning: Board {0}:{1}:{2} doesn''t define a ''build.board'' preference. Auto-set to: {3}" -const MSG_MISSING_CORE_FOR_BOARD = "Selected board depends on '{0}' core (not installed)." -const MSG_PACKAGE_UNKNOWN = "{0}: Unknown package" -const MSG_PLATFORM_UNKNOWN = "Platform {0} (package {1}) is unknown" -const MSG_PROGRESS = "Progress {0}" -const MSG_PROP_IN_LIBRARY = "Missing '{0}' from library in {1}" -const MSG_RUNNING_COMMAND = "Ts: {0} - Running: {1}" -const MSG_RUNNING_RECIPE = "Running recipe: {0}" -const MSG_SETTING_BUILD_PATH = "Setting build path to {0}" -const MSG_SIZER_TEXT_FULL = "Sketch uses {0} bytes ({2}%%) of program storage space. Maximum is {1} bytes." -const MSG_SIZER_DATA_FULL = "Global variables use {0} bytes ({2}%%) of dynamic memory, leaving {3} bytes for local variables. Maximum is {1} bytes." -const MSG_SIZER_DATA = "Global variables use {0} bytes of dynamic memory." -const MSG_SIZER_TEXT_TOO_BIG = "Sketch too big; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing it." -const MSG_SIZER_DATA_TOO_BIG = "Not enough memory; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing your footprint." -const MSG_SIZER_LOW_MEMORY = "Low memory available, stability problems may occur." -const MSG_SIZER_ERROR_NO_RULE = "Couldn't determine program size" -const MSG_SKETCH_CANT_BE_IN_BUILDPATH = "Sketch cannot be located in build path. Please specify a different build path" -const MSG_UNKNOWN_SKETCH_EXT = "Unknown sketch file extension: {0}" -const MSG_USING_LIBRARY_AT_VERSION = "Using library {0} at version {1} in folder: {2} {3}" -const MSG_USING_LIBRARY = "Using library {0} in folder: {1} {2}" -const MSG_USING_BOARD = "Using board '{0}' from platform in folder: {1}" -const MSG_USING_CORE = "Using core '{0}' from platform in folder: {1}" -const MSG_USING_PREVIOUS_COMPILED_FILE = "Using previously compiled file: {0}" -const MSG_USING_CACHED_INCLUDES = "Using cached library dependencies for file: {0}" -const MSG_WARNING_LIB_INVALID_CATEGORY = "WARNING: Category '{0}' in library {1} is not valid. Setting to '{2}'" -const MSG_WARNING_PLATFORM_OLD_VALUES = "Warning: platform.txt from core '{0}' contains deprecated {1}, automatically converted to {2}. Consider upgrading this core." -const MSG_WARNING_SPURIOUS_FILE_IN_LIB = "WARNING: Spurious {0} folder in '{1}' library" + +var MSG_ARCH_FOLDER_NOT_SUPPORTED = fmt.Sprintf(tr("%[1]s folder is no longer supported! See %[2]s for more information"), "'arch'", "http://goo.gl/gfFJzU") +var MSG_ARCHIVING_CORE_CACHE = tr("Archiving built core (caching) in: {0}") +var MSG_ERROR_ARCHIVING_CORE_CACHE = tr("Error archiving built core (caching) in {0}: {1}") +var MSG_CORE_CACHE_UNAVAILABLE = fmt.Sprintf(tr("Unable to cache built core, please tell {0} maintainers to follow %s"), "https://arduino.github.io/arduino-cli/latest/platform-specification/#recipes-to-build-the-corea-archive-file") +var MSG_BOARD_UNKNOWN = tr("Board {0} (platform {1}, package {2}) is unknown") +var MSG_BOOTLOADER_FILE_MISSING = tr("Bootloader file specified but missing: {0}") +var MSG_REBUILD_ALL = tr(", rebuilding all") +var MSG_BUILD_OPTIONS_CHANGED = tr("Build options changed") +var MSG_BUILD_OPTIONS_INVALID = tr("{0} invalid") +var MSG_CANT_FIND_SKETCH_IN_PATH = tr("Unable to find {0} in {1}") +var MSG_FQBN_INVALID = tr("{0} is not a valid fully qualified board name. Required format is targetPackageName:targetPlatformName:targetBoardName.") +var MSG_SKIP_PRECOMPILED_LIBRARY = tr("Skipping dependencies detection for precompiled library {0}") +var MSG_FIND_INCLUDES_FAILED = tr("Error while detecting libraries included by {0}") +var MSG_LIB_LEGACY = tr("(legacy)") +var MSG_LIBRARIES_MULTIPLE_LIBS_FOUND_FOR = tr("Multiple libraries were found for \"{0}\"") +var MSG_LIBRARIES_NOT_USED = tr(" Not used: {0}") +var MSG_LIBRARIES_USED = tr(" Used: {0}") +var MSG_LIBRARY_CAN_USE_SRC_AND_UTILITY_FOLDERS = fmt.Sprintf(tr("Library can't use both '%[1]s' and '%[2]s' folders. Double check {0}"), "src", "utility") +var MSG_LIBRARY_INCOMPATIBLE_ARCH = tr("WARNING: library {0} claims to run on {1} architecture(s) and may be incompatible with your current board which runs on {2} architecture(s).") +var MSG_LOOKING_FOR_RECIPES = tr("Looking for recipes like {0}*{1}") +var MSG_MISSING_BUILD_BOARD = fmt.Sprintf(tr("Warning: Board {0}:{1}:{2} doesn''t define a %s preference. Auto-set to: {3}"), "''build.board''") +var MSG_MISSING_CORE_FOR_BOARD = tr("Selected board depends on '{0}' core (not installed).") +var MSG_PACKAGE_UNKNOWN = tr("{0}: Unknown package") +var MSG_PLATFORM_UNKNOWN = tr("Platform {0} (package {1}) is unknown") +var MSG_PROGRESS = tr("Progress {0}") +var MSG_PROP_IN_LIBRARY = tr("Missing '{0}' from library in {1}") +var MSG_RUNNING_COMMAND = tr("Ts: {0} - Running: {1}") +var MSG_RUNNING_RECIPE = tr("Running recipe: {0}") +var MSG_SETTING_BUILD_PATH = tr("Setting build path to {0}") +var MSG_SIZER_TEXT_FULL = tr("Sketch uses {0} bytes ({2}%%) of program storage space. Maximum is {1} bytes.") +var MSG_SIZER_DATA_FULL = tr("Global variables use {0} bytes ({2}%%) of dynamic memory, leaving {3} bytes for local variables. Maximum is {1} bytes.") +var MSG_SIZER_DATA = tr("Global variables use {0} bytes of dynamic memory.") +var MSG_SIZER_TEXT_TOO_BIG = fmt.Sprintf(tr("Sketch too big; see %s for tips on reducing it."), "https://support.arduino.cc/hc/en-us/articles/360013825179") +var MSG_SIZER_DATA_TOO_BIG = fmt.Sprintf(tr("Not enough memory; see %s for tips on reducing your footprint."), "https://support.arduino.cc/hc/en-us/articles/360013825179") +var MSG_SIZER_LOW_MEMORY = tr("Low memory available, stability problems may occur.") +var MSG_SIZER_ERROR_NO_RULE = tr("Couldn't determine program size") +var MSG_SKETCH_CANT_BE_IN_BUILDPATH = tr("Sketch cannot be located in build path. Please specify a different build path") +var MSG_UNKNOWN_SKETCH_EXT = tr("Unknown sketch file extension: {0}") +var MSG_USING_LIBRARY_AT_VERSION = tr("Using library {0} at version {1} in folder: {2} {3}") +var MSG_USING_LIBRARY = tr("Using library {0} in folder: {1} {2}") +var MSG_USING_BOARD = tr("Using board '{0}' from platform in folder: {1}") +var MSG_USING_CORE = tr("Using core '{0}' from platform in folder: {1}") +var MSG_USING_PREVIOUS_COMPILED_FILE = tr("Using previously compiled file: {0}") +var MSG_USING_CACHED_INCLUDES = tr("Using cached library dependencies for file: {0}") +var MSG_WARNING_LIB_INVALID_CATEGORY = tr("WARNING: Category '{0}' in library {1} is not valid. Setting to '{2}'") +var MSG_WARNING_PLATFORM_OLD_VALUES = tr("Warning: platform.txt from core '{0}' contains deprecated {1}, automatically converted to {2}. Consider upgrading this core.") +var MSG_WARNING_SPURIOUS_FILE_IN_LIB = tr("WARNING: Spurious {0} folder in '{1}' library") + const PACKAGE_NAME = "name" const PACKAGE_TOOLS = "tools" const PLATFORM_ARCHITECTURE = "architecture" diff --git a/legacy/builder/container_find_includes.go b/legacy/builder/container_find_includes.go index 98c72bfce4a..8292b10eba7 100644 --- a/legacy/builder/container_find_includes.go +++ b/legacy/builder/container_find_includes.go @@ -375,7 +375,7 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFile t // gcc does not reproduce that, there is something wrong. // Returning an error here will cause the cache to be // deleted, so hopefully the next compilation will succeed. - return errors.New("Internal error in cache") + return errors.New(tr("Internal error in cache")) } } os.Stderr.Write(preproc_stderr) diff --git a/legacy/builder/container_setup.go b/legacy/builder/container_setup.go index 038f66d92b4..e2f01ec3616 100644 --- a/legacy/builder/container_setup.go +++ b/legacy/builder/container_setup.go @@ -71,7 +71,7 @@ func (s *ContainerSetupHardwareToolsLibsSketchAndProps) Run(ctx *types.Context) return errors.WithStack(err) } if sketch.MainFile == nil { - return fmt.Errorf("main file missing from sketch") + return fmt.Errorf(tr("main file missing from sketch")) } sketch.BuildPath = ctx.BuildPath ctx.SketchLocation = sketch.MainFile diff --git a/legacy/builder/ctags_runner.go b/legacy/builder/ctags_runner.go index 553e1466d70..299ffb45962 100644 --- a/legacy/builder/ctags_runner.go +++ b/legacy/builder/ctags_runner.go @@ -38,7 +38,7 @@ func (s *CTagsRunner) Run(ctx *types.Context) error { pattern := ctagsProperties.Get(constants.BUILD_PROPERTIES_PATTERN) if pattern == constants.EMPTY_STRING { - return errors.Errorf("%s pattern is missing", constants.CTAGS) + return errors.Errorf(tr("%s pattern is missing"), constants.CTAGS) } commandLine := ctagsProperties.ExpandPropsInString(pattern) diff --git a/legacy/builder/phases/core_builder.go b/legacy/builder/phases/core_builder.go index ef8e0b06e0d..ea609fb9a73 100644 --- a/legacy/builder/phases/core_builder.go +++ b/legacy/builder/phases/core_builder.go @@ -19,6 +19,7 @@ import ( "os" "strings" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/legacy/builder/builder_utils" "github.com/arduino/arduino-cli/legacy/builder/constants" "github.com/arduino/arduino-cli/legacy/builder/types" @@ -30,6 +31,8 @@ import ( type CoreBuilder struct{} +var tr = i18n.Tr + func (s *CoreBuilder) Run(ctx *types.Context) error { coreBuildPath := ctx.CoreBuildPath coreBuildCachePath := ctx.CoreBuildCachePath @@ -42,8 +45,8 @@ func (s *CoreBuilder) Run(ctx *types.Context) error { if coreBuildCachePath != nil { if _, err := coreBuildCachePath.RelTo(ctx.BuildPath); err != nil { logger := ctx.GetLogger() - logger.Println(constants.LOG_LEVEL_INFO, "Couldn't deeply cache core build: {0}", err) - logger.Println(constants.LOG_LEVEL_INFO, "Running normal build of the core...") + logger.Println(constants.LOG_LEVEL_INFO, tr("Couldn't deeply cache core build: {0}"), err) + logger.Println(constants.LOG_LEVEL_INFO, tr("Running normal build of the core...")) coreBuildCachePath = nil ctx.CoreBuildCachePath = nil } else if err := coreBuildCachePath.MkdirAll(); err != nil { @@ -101,7 +104,7 @@ func compileCore(ctx *types.Context, buildPath *paths.Path, buildCachePath *path if canUseArchivedCore { // use archived core if ctx.Verbose { - logger.Println(constants.LOG_LEVEL_INFO, "Using precompiled core: {0}", targetArchivedCore) + logger.Println(constants.LOG_LEVEL_INFO, tr("Using precompiled core: {0}"), targetArchivedCore) } return targetArchivedCore, variantObjectFiles, nil } diff --git a/legacy/builder/phases/libraries_builder.go b/legacy/builder/phases/libraries_builder.go index ba8529d865e..a5253f76303 100644 --- a/legacy/builder/phases/libraries_builder.go +++ b/legacy/builder/phases/libraries_builder.go @@ -88,25 +88,25 @@ func findExpectedPrecompiledLibFolder(ctx *types.Context, library *libraries.Lib } logger := ctx.GetLogger() - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_INFO, "Library {0} has been declared precompiled:", library.Name) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_INFO, tr("Library {0} has been declared precompiled:"), library.Name) // Try directory with full fpuSpecs first, if available if len(fpuSpecs) > 0 { fpuSpecs = strings.TrimRight(fpuSpecs, "-") fullPrecompDir := library.SourceDir.Join(mcu).Join(fpuSpecs) if fullPrecompDir.Exist() && directoryContainsFile(fullPrecompDir) { - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_INFO, "Using precompiled library in {0}", fullPrecompDir) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_INFO, tr("Using precompiled library in {0}"), fullPrecompDir) return fullPrecompDir } - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_INFO, "Precompiled library in \"{0}\" not found", fullPrecompDir) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_INFO, tr("Precompiled library in \"{0}\" not found"), fullPrecompDir) } precompDir := library.SourceDir.Join(mcu) if precompDir.Exist() && directoryContainsFile(precompDir) { - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_INFO, "Using precompiled library in {0}", precompDir) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_INFO, tr("Using precompiled library in {0}"), precompDir) return precompDir } - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_INFO, "Precompiled library in \"{0}\" not found", precompDir) + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_INFO, tr("Precompiled library in \"{0}\" not found"), precompDir) return nil } @@ -132,7 +132,7 @@ func compileLibraries(ctx *types.Context, libraries libraries.List, buildPath *p func compileLibrary(ctx *types.Context, library *libraries.Library, buildPath *paths.Path, buildProperties *properties.Map, includes []string) (paths.PathList, error) { logger := ctx.GetLogger() if ctx.Verbose { - logger.Println(constants.LOG_LEVEL_INFO, "Compiling library \"{0}\"", library.Name) + logger.Println(constants.LOG_LEVEL_INFO, tr("Compiling library \"{0}\""), library.Name) } libraryBuildPath := buildPath.Join(library.Name) @@ -148,7 +148,7 @@ func compileLibrary(ctx *types.Context, library *libraries.Library, buildPath *p if !coreSupportPrecompiled { logger := ctx.GetLogger() - logger.Fprintln(os.Stdout, constants.LOG_LEVEL_INFO, "The platform does not support 'compiler.libraries.ldflags' for precompiled libraries.") + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_INFO, tr("The platform does not support '{0}' for precompiled libraries."), "compiler.libraries.ldflags") } else if precompiledPath != nil { // Find all libraries in precompiledPath diff --git a/legacy/builder/phases/linker.go b/legacy/builder/phases/linker.go index f42f431bfe9..5b1b4b1f7d7 100644 --- a/legacy/builder/phases/linker.go +++ b/legacy/builder/phases/linker.go @@ -32,7 +32,7 @@ type Linker struct{} func (s *Linker) Run(ctx *types.Context) error { if ctx.OnlyUpdateCompilationDatabase { if ctx.Verbose { - ctx.GetLogger().Println("info", "Skip linking of final executable.") + ctx.GetLogger().Println("info", tr("Skip linking of final executable.")) } return nil } diff --git a/legacy/builder/phases/sizer.go b/legacy/builder/phases/sizer.go index 482fb5aa35b..b961e972747 100644 --- a/legacy/builder/phases/sizer.go +++ b/legacy/builder/phases/sizer.go @@ -16,6 +16,7 @@ package phases import ( + "fmt" "regexp" "strconv" @@ -107,12 +108,12 @@ func checkSize(ctx *types.Context, buildProperties *properties.Map) error { if textSize > maxTextSize { logger.Println(constants.LOG_LEVEL_ERROR, constants.MSG_SIZER_TEXT_TOO_BIG) - return errors.New("text section exceeds available space in board") + return errors.New(tr("text section exceeds available space in board")) } if maxDataSize > 0 && dataSize > maxDataSize { logger.Println(constants.LOG_LEVEL_ERROR, constants.MSG_SIZER_DATA_TOO_BIG) - return errors.New("data section exceeds available space in board") + return errors.New(tr("data section exceeds available space in board")) } if properties.Get(constants.PROPERTY_WARN_DATA_PERCENT) != "" { @@ -131,13 +132,13 @@ func checkSize(ctx *types.Context, buildProperties *properties.Map) error { func execSizeRecipe(ctx *types.Context, properties *properties.Map) (textSize int, dataSize int, eepromSize int, resErr error) { command, err := builder_utils.PrepareCommandForRecipe(properties, constants.RECIPE_SIZE_PATTERN, false) if err != nil { - resErr = errors.New("Error while determining sketch size: " + err.Error()) + resErr = fmt.Errorf(tr("Error while determining sketch size: %s"), err) return } out, _, err := utils.ExecCommand(ctx, command, utils.Capture /* stdout */, utils.Show /* stderr */) if err != nil { - resErr = errors.New("Error while determining sketch size: " + err.Error()) + resErr = fmt.Errorf(tr("Error while determining sketch size: %s"), err) return } @@ -146,23 +147,23 @@ func execSizeRecipe(ctx *types.Context, properties *properties.Map) (textSize in textSize, err = computeSize(properties.Get(constants.RECIPE_SIZE_REGEXP), out) if err != nil { - resErr = errors.New("Invalid size regexp: " + err.Error()) + resErr = fmt.Errorf(tr("Invalid size regexp: %s"), err) return } if textSize == -1 { - resErr = errors.New("Missing size regexp") + resErr = errors.New(tr("Missing size regexp")) return } dataSize, err = computeSize(properties.Get(constants.RECIPE_SIZE_REGEXP_DATA), out) if err != nil { - resErr = errors.New("Invalid data size regexp: " + err.Error()) + resErr = fmt.Errorf(tr("Invalid data size regexp: %s"), err) return } eepromSize, err = computeSize(properties.Get(constants.RECIPE_SIZE_REGEXP_EEPROM), out) if err != nil { - resErr = errors.New("Invalid eeprom size regexp: " + err.Error()) + resErr = fmt.Errorf(tr("Invalid eeprom size regexp: %s"), err) return } diff --git a/legacy/builder/preprocess_sketch.go b/legacy/builder/preprocess_sketch.go index c8dee8a91a4..8b272093b95 100644 --- a/legacy/builder/preprocess_sketch.go +++ b/legacy/builder/preprocess_sketch.go @@ -100,7 +100,7 @@ func (s *ArduinoPreprocessorRunner) Run(ctx *types.Context) error { pattern := preprocProperties.Get(constants.BUILD_PROPERTIES_PATTERN) if pattern == constants.EMPTY_STRING { - return errors.New("arduino-preprocessor pattern is missing") + return errors.New(tr("arduino-preprocessor pattern is missing")) } commandLine := preprocProperties.ExpandPropsInString(pattern) diff --git a/legacy/builder/recipe_runner.go b/legacy/builder/recipe_runner.go index 9f04598d1e6..f4c0845ec66 100644 --- a/legacy/builder/recipe_runner.go +++ b/legacy/builder/recipe_runner.go @@ -55,7 +55,7 @@ func (s *RecipeByPrefixSuffixRunner) Run(ctx *types.Context) error { if ctx.OnlyUpdateCompilationDatabase { if ctx.Verbose { - ctx.GetLogger().Println("info", "Skipping: {0}", strings.Join(command.Args, " ")) + ctx.GetLogger().Println("info", tr("Skipping: {0}"), strings.Join(command.Args, " ")) } return nil } diff --git a/legacy/builder/resolve_library.go b/legacy/builder/resolve_library.go index bcdc5b61c9b..8a4be210831 100644 --- a/legacy/builder/resolve_library.go +++ b/legacy/builder/resolve_library.go @@ -31,9 +31,9 @@ func ResolveLibrary(ctx *types.Context, header string) *libraries.Library { logger := ctx.GetLogger() if ctx.Verbose { - logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf("Alternatives for %s: %s", header, candidates)) + logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf(tr("Alternatives for %[1]s: %[2]s"), header, candidates)) logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf("ResolveLibrary(%s)", header)) - logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf(" -> candidates: %s", candidates)) + logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf(tr(" -> candidates: %s"), candidates)) } if candidates == nil || len(candidates) == 0 { diff --git a/legacy/builder/target_board_resolver.go b/legacy/builder/target_board_resolver.go index 9e9543bb9b6..7eb52d9b9f8 100644 --- a/legacy/builder/target_board_resolver.go +++ b/legacy/builder/target_board_resolver.go @@ -30,7 +30,7 @@ func (s *TargetBoardResolver) Run(ctx *types.Context) error { targetPackage, targetPlatform, targetBoard, buildProperties, actualPlatform, err := ctx.PackageManager.ResolveFQBN(ctx.FQBN) if err != nil { - return i18n.ErrorfWithLogger(logger, "Error resolving FQBN: {0}", err) + return i18n.ErrorfWithLogger(logger, tr("Error resolving FQBN: {0}"), err) } targetBoard.Properties = buildProperties // FIXME.... diff --git a/legacy/builder/types/context.go b/legacy/builder/types/context.go index c475460dd0b..a3f8ee98626 100644 --- a/legacy/builder/types/context.go +++ b/legacy/builder/types/context.go @@ -236,7 +236,7 @@ func (ctx *Context) InjectBuildOptions(opts *properties.Map) { ctx.SketchLocation = opts.GetPath("sketchLocation") fqbn, err := cores.ParseFQBN(opts.Get("fqbn")) if err != nil { - i18n.ErrorfWithLogger(ctx.GetLogger(), "Error in FQBN: %s", err) + i18n.ErrorfWithLogger(ctx.GetLogger(), tr("Error in FQBN: %s"), err) } ctx.FQBN = fqbn ctx.ArduinoAPIVersion = opts.Get("runtime.ide.version") diff --git a/legacy/builder/types/types.go b/legacy/builder/types/types.go index 70ee1c34608..c4e3625e599 100644 --- a/legacy/builder/types/types.go +++ b/legacy/builder/types/types.go @@ -21,9 +21,12 @@ import ( "github.com/arduino/arduino-cli/arduino/libraries" "github.com/arduino/arduino-cli/arduino/sketch" + "github.com/arduino/arduino-cli/i18n" paths "github.com/arduino/go-paths-helper" ) +var tr = i18n.Tr + type SourceFile struct { // Sketch or Library pointer that this source file lives in Origin interface{} diff --git a/legacy/builder/utils/utils.go b/legacy/builder/utils/utils.go index 58fb161f5fc..3efccb5a0d1 100644 --- a/legacy/builder/utils/utils.go +++ b/legacy/builder/utils/utils.go @@ -29,6 +29,7 @@ import ( "unicode" "unicode/utf8" + "github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/legacy/builder/gohasissues" "github.com/arduino/arduino-cli/legacy/builder/types" paths "github.com/arduino/go-paths-helper" @@ -39,6 +40,8 @@ import ( type filterFiles func([]os.FileInfo) []os.FileInfo +var tr = i18n.Tr + func ReadDirFiltered(folder string, fn filterFiles) ([]os.FileInfo, error) { files, err := gohasissues.ReadDir(folder) if err != nil { @@ -457,7 +460,7 @@ func CopyDir(src string, dst string, extensions CheckExtensionFunc) (err error) return err } if !si.IsDir() { - return fmt.Errorf("source is not a directory") + return fmt.Errorf(tr("source is not a directory")) } _, err = os.Stat(dst) @@ -465,7 +468,7 @@ func CopyDir(src string, dst string, extensions CheckExtensionFunc) (err error) return } if err == nil { - return fmt.Errorf("destination already exists") + return fmt.Errorf(tr("destination already exists")) } err = os.MkdirAll(dst, si.Mode()) diff --git a/legacy/builder/wipeout_build_path_if_build_options_changed.go b/legacy/builder/wipeout_build_path_if_build_options_changed.go index 9ba8d17b606..0bbc10b642d 100644 --- a/legacy/builder/wipeout_build_path_if_build_options_changed.go +++ b/legacy/builder/wipeout_build_path_if_build_options_changed.go @@ -82,11 +82,11 @@ func doCleanup(buildPath *paths.Path) error { // logger.Println(constants.LOG_LEVEL_INFO, constants.MSG_BUILD_OPTIONS_CHANGED + constants.MSG_REBUILD_ALL) if files, err := buildPath.ReadDir(); err != nil { - return errors.WithMessage(err, "cleaning build path") + return errors.WithMessage(err, tr("cleaning build path")) } else { for _, file := range files { if err := file.RemoveAll(); err != nil { - return errors.WithMessage(err, "cleaning build path") + return errors.WithMessage(err, tr("cleaning build path")) } } } diff --git a/version/version.go b/version/version.go index 65321df753f..bbf1bb27ea1 100644 --- a/version/version.go +++ b/version/version.go @@ -17,6 +17,8 @@ package version import ( "fmt" + + "github.com/arduino/arduino-cli/i18n" ) var ( @@ -25,6 +27,7 @@ var ( commit = "" status = "alpha" date = "" + tr = i18n.Tr ) // Info FIXMEDOC @@ -48,7 +51,7 @@ func NewInfo(application string) *Info { } func (i *Info) String() string { - return fmt.Sprintf("%s %s Version: %s Commit: %s Date: %s", i.Application, i.Status, i.VersionString, i.Commit, i.Date) + return fmt.Sprintf(tr("%[1]s %[2]s Version: %[3]s Commit: %[4]s Date: %[5]s"), i.Application, i.Status, i.VersionString, i.Commit, i.Date) } //nolint:gochecknoinits