Skip to content

Commit

Permalink
Added localization code to pipeline and created one LocProject json f…
Browse files Browse the repository at this point in the history
…or Settings
  • Loading branch information
arjunbalgovind committed Aug 14, 2020
1 parent 5c1713f commit d5eceb3
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .pipelines/build-localization.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@echo off

cd /D "%~dp0"

echo Preparing localization build...

setlocal

rem In this sample, the repo root is identical to the script directory path. Adjust the value of the RepoRoot variable accordingly based on your environment.
rem Again, ensure the RepoRoot variable is set to the real repo root location, otherwise the localization toolset wouldn't work as intended.
rem Note that the resolved %~dp0 ends with \.
set RepoRoot=%~dp0..\
set OutDir=%RepoRoot%out
set NUGET_PACKAGES=%RepoRoot%packages
set LocalizationXLocPkgVer=2.0.0

nuget install Localization.XLoc -Version %LocalizationXLocPkgVer% -OutputDirectory "%NUGET_PACKAGES%" -NonInteractive -Verbosity detailed
if "%errorlevel%" neq "0" (
exit /b %errorlevel%
)

nuget install LSBuild.XLoc -OutputDirectory "%NUGET_PACKAGES%" -NonInteractive -Verbosity detailed
if "%errorlevel%" neq "0" (
exit /b %errorlevel%
)

nuget install Localization.Languages -OutputDirectory "%NUGET_PACKAGES%" -NonInteractive -Verbosity detailed
if "%errorlevel%" neq "0" (
exit /b %errorlevel%
)

echo Running localization build...

set XLocPath=%NUGET_PACKAGES%\Localization.XLoc.%LocalizationXLocPkgVer%
set LocProject=%RepoRoot%src\core\Microsoft.PowerToys.Settings.UI\LocProject.json

dotnet "%XLocPath%\tools\netcore\Microsoft.Localization.XLoc.dll" /f "%LocProject%"

echo Localization build finished with exit code '%errorlevel%'.

exit /b %errorlevel%
10 changes: 10 additions & 0 deletions .pipelines/pipeline.user.windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package_sources:
feeds:
'Nuget': 'https://api.nuget.org/v3/index.json'
'PipelineBuildSupplement': 'https://msazure.pkgs.visualstudio.com/_packaging/PipelineBuildSupplement/nuget/v3/index.json'
'Toolset': 'ttps://msazure.pkgs.visualstudio.com/_packaging/Toolset/nuget/v3/index.json'

This comment has been minimized.

Copy link
@crutkas

crutkas Aug 17, 2020

Member

this says ttps, not https

This comment has been minimized.

Copy link
@arjunbalgovind

arjunbalgovind Aug 17, 2020

Author Contributor

Yeah, fixed that in a later commit (0c4a9f9) since the pipeline failed because of that typo.


restore:
commands:
Expand All @@ -37,6 +38,15 @@ restore:

build:
commands:
- !!buildcommand
name: 'Localization Build'
command: '.pipelines\build-localization.cmd'
artifacts:
- from: 'out\loc'
to: 'loc'
include:
- '**/*'

- !!buildcommand
name: 'Build Power Toys'
command: '.pipelines\build.cmd'
Expand Down
4 changes: 4 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Toolset" value="https://msazure.pkgs.visualstudio.com/_packaging/Toolset/nuget/v3/index.json" />
</packageSources>
<config>
<clear />
</config>
Expand Down
14 changes: 14 additions & 0 deletions src/core/Microsoft.PowerToys.Settings.UI/LocProject.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Projects": [
{
"LanguageSet": "Windows10_Languages",
"LocItems": [
{
"SourceFile": "src\\core\\Microsoft.PowerToys.Settings.UI\\Strings\\en-us\\Resources.resw",
"CopyOption": "LangIDOnPath",
"OutputPath": "src\\core\\Microsoft.PowerToys.Settings.UI\\Strings"
}
]
}
]
}

0 comments on commit d5eceb3

Please sign in to comment.