mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
Live Template: use i18n attributes, update docs
This commit is contained in:
parent
28e9ef8dc4
commit
e4cfe8aeec
@ -32,6 +32,8 @@
|
||||
<!-- Text to display as company information on Settings | Plugin page -->
|
||||
<vendor url="https://plugins.jetbrains.com">IntelliJ Platform SDK</vendor>
|
||||
|
||||
<resource-bundle>messages.LiveTemplates</resource-bundle>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<defaultLiveTemplates file="/liveTemplates/Markdown.xml"/>
|
||||
<liveTemplateContext implementation="org.intellij.sdk.liveTemplates.MarkdownContext"
|
||||
|
@ -1,9 +1,9 @@
|
||||
<templateSet group="Markdown">
|
||||
<template name="{"
|
||||
value="[$TEXT$]($LINK$)$END$"
|
||||
description="SDK: New link reference"
|
||||
toReformat="false"
|
||||
toShortenFQNames="false">
|
||||
toShortenFQNames="false"
|
||||
key="live.template.{.description" resource-bundle="messages.LiveTemplates">
|
||||
<variable name="TEXT" expression="" defaultValue="" alwaysStopAt="true"/>
|
||||
<variable name="LINK" expression="complete()" defaultValue="" alwaysStopAt="true"/>
|
||||
<context>
|
||||
@ -12,12 +12,12 @@
|
||||
</template>
|
||||
<template name="mc"
|
||||
value="$TITLE$"
|
||||
description="SDK: Convert to title case"
|
||||
toReformat="true"
|
||||
toShortenFQNames="false">
|
||||
toShortenFQNames="false"
|
||||
key="live.template.mc.description" resource-bundle="messages.LiveTemplates">
|
||||
<variable name="TITLE" expression="titleCase(SELECTION)" defaultValue="the quick brown fox" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="MARKDOWN" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
</templateSet>
|
||||
</templateSet>
|
||||
|
@ -0,0 +1,2 @@
|
||||
live.template.mc.description=SDK: Convert to title case
|
||||
live.template.{.description=SDK: New link reference
|
@ -1,6 +1,6 @@
|
||||
# Providing Live Templates
|
||||
<!-- Copyright 2000-2024 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
|
||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
# Providing Live Templates
|
||||
|
||||
<link-summary>Adding custom Live Templates.</link-summary>
|
||||
|
||||
@ -57,7 +57,9 @@ The export produces a file called <path>Markdown.xml</path> with the following c
|
||||
</templateSet>
|
||||
```
|
||||
|
||||
The display `name` can also provide localized variants by specifying `key` and `resource-bundle` attributes additionally (2020.3 and later).
|
||||
The display `description` can also provide localized variants by specifying
|
||||
`key` and `resource-bundle` attributes instead (code insight is available in 2020.3 and later).
|
||||
A quick fix to extract the localized key is available since 2024.2.
|
||||
|
||||
Copy this file into the [plugin's resources folder](%gh-sdk-samples%/live_templates/src/main/resources/liveTemplates).
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user