Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Documentation/workflow/Localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,23 @@ so when adding a new message, follow these steps:

6. The [OneLocBuild][oneloc] task will manage handoff and handback for string translations.

### Templates
## Templates

All updates to `src/Microsoft.Android.Templates` should be built locally to update the
`templatestrings.*.json` used for localization. The [OneLocBuild][oneloc] task
will manage handoff and handback for string translations after the
`templatestrings.*.json` changes are committed.

Templates localization files are *NOT* rebuilt by default. In order to rebuild them it is
necessary to build the templates project in one of the following ways:

* On Unix systems run `make LOCALIZE_TEMPLATES=true prepare all` (the `prepare` parameter
can be omitted if it was ran previously)
* On all systems run `dotnet-local.sh -p:LocalizeTemplates=true -t:ConfigureLocalWorkload build-tools/create-packs/Microsoft.Android.Sdk.proj`

This will generate all the changed localization files, which then need to be comitted and pushed
to the repository.

## Guidelines

* When an error or warning code is used with more than one output string, use
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ PREPARE_SCENARIO =
PREPARE_CI_PR ?= 0
PREPARE_CI ?= 0
PREPARE_AUTOPROVISION ?= 0
LOCALIZE_TEMPLATES ?= 0

_PREPARE_CI_MODE_PR_ARGS = --no-emoji --run-mode=CI
_PREPARE_CI_MODE_ARGS = $(_PREPARE_CI_MODE_PR_ARGS) -a
_PREPARE_ARGS =

all:
$(call DOTNET_BINLOG,all) $(MSBUILD_FLAGS) $(SOLUTION)
$(call DOTNET_BINLOG,setup-workload) -t:ConfigureLocalWorkload build-tools/create-packs/Microsoft.Android.Sdk.proj
$(call DOTNET_BINLOG,setup-workload) $(MSBUILD_FLAGS) -t:ConfigureLocalWorkload build-tools/create-packs/Microsoft.Android.Sdk.proj


ifeq ($(OS_NAME),)
Expand Down Expand Up @@ -73,6 +74,10 @@ ifeq ($(USE_MSBUILD),1)
_SLN_BUILD = $(MSBUILD)
endif # $(USE_MSBUILD) == 1

ifneq ($(LOCALIZE_TEMPLATES),0)
MSBUILD_FLAGS += -p:LocalizeTemplates=true
endif

ifneq ($(API_LEVEL),)
MSBUILD_FLAGS += /p:AndroidApiLevel=$(API_LEVEL) /p:AndroidFrameworkVersion=$(word $(API_LEVEL), $(ALL_FRAMEWORKS)) /p:AndroidPlatformId=$(word $(a), $(ALL_PLATFORM_IDS))
endif
Expand Down
1 change: 1 addition & 0 deletions build-tools/create-packs/ConfigureLocalWorkload.targets
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
Outputs="@(_TemplatesOutputs)">
<ItemGroup>
<_PackProps Include="-v:n -c $(Configuration)" />
<_PackProps Condition=" '$(LocalizeTemplates)' != '' " Include="-p:LocalizeTemplates=$(LocalizeTemplates)" />
<_PackProps Include="-p:IncludeSymbols=False" />
<_PackProps Include="-p:OutputPath=$(BuildOutputDirectory)lib\template-packs" />
<_PackProps Include="-p:TemplatePackVersion=$(AndroidPackVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<Description>Templates for Android platforms.</Description>
<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
<LocalizeTemplates Condition=" '$(RunningOnCI)' != 'true' ">true</LocalizeTemplates>
<!-- Only localize templates on demand avoid verbose template localizer output during local development -->
<!-- Set this property to `true` on command line, or uncomment it below, to enable localization -->
<!-- LocalizeTemplates>true</LocalizeTemplates -->
<ContentTargetFolders>content</ContentTargetFolders>
<OutputPath>..\..\bin\Build$(Configuration)\nuget-unsigned\</OutputPath>
<!-- Remove the `<group targetFramework=".NETStandard2.0" />` entry from the .nuspec. -->
Expand All @@ -24,7 +26,7 @@
<Compile Remove="**\*" />
</ItemGroup>

<ItemGroup Condition=" '$(RunningOnCI)' != 'true' ">
<ItemGroup Condition=" '$(LocalizeTemplates)' == 'true' ">
<PackageReference Include="Microsoft.TemplateEngine.Authoring.Tasks" Version="$(MicrosoftTemplateEngineAuthoringTasksPackageVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
</ItemGroup>

Expand Down
Loading