Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local languages #2851

Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni

=== Added

- Added Korean language support for UI, experimental.
- Added option ``caret style`` to change insert caret to `block` or `line` in Text Editor, by editing ``settings.cfg``.
The color of the caret is the same as `setting` and will be adjusted for better contrast with the background.

Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Likewise, the current version of wxPython, is 4.2.1, but RIDE is known to work w

`pip install -U robotframework-ride`

(3.8 <= python <= 3.12) Install current development version (**2.1dev67**) with:
(3.8 <= python <= 3.12) Install current development version (**2.1dev68**) with:

`pip install -U https://github.com/robotframework/RIDE/archive/master.zip`

Expand Down
2 changes: 2 additions & 0 deletions src/robotide/application/CHANGELOG.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Changelog</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /></head><body><div xml:lang="en" class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id1337"></a>Changelog</h2></div></div><hr /></div><p>All notable changes to this project will be documented in this file.</p><p>The format is based on <a class="ulink" href="http://keepachangelog.com/en/1.0.0/" target="_top">Keep a Changelog</a>
and this project adheres to <a class="ulink" href="http://semver.org/spec/v2.0.0.html" target="_top">Semantic Versioning</a>.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_ulink_url_https_github_com_robotframework_ride_unreleased_ulink"></a>1. <a class="ulink" href="https://github.com/robotframework/RIDE" target="_top">Unreleased</a></h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_added"></a>1.1. Added</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Added Korean language support for UI, experimental.
</li><li class="listitem">
Added option ``caret style`` to change insert caret to <code class="literal">block</code> or <code class="literal">line</code> in Text Editor, by editing ``settings.cfg``.
The color of the caret is the same as <code class="literal">setting</code> and will be adjusted for better contrast with the background.
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_changed"></a>1.2. Changed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Expand Down
4 changes: 3 additions & 1 deletion src/robotide/application/releasenotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def set_content(self, html_win, content):
<li>This version supports Python 3.8 up to 3.12.</li>
<li>There are some changes, or known issues:<ul>
<li>❌ - Removed support for Python 3.6 and 3.7</li>
<li>✔ - Added Korean language support for UI, experimental.</li>
<li>✔ - Added <b>caret style</b> to change insert caret to 'block' or 'line' in Text Editor, by editing
<em>settings.cfg</em>. The color of the caret is the same as 'setting' and will be adjusted for better contrast with the
background.</li>
Expand Down Expand Up @@ -196,6 +197,7 @@ def set_content(self, html_win, content):
</ul>
<p><strong>New Features and Fixes Highlights</strong></p>
<ul class="simple">
<li>Added Korean language support for UI, experimental.</li>
<li>Fixed wrong item selection, like Test Suite, when doing right-click actions in Project Explorer.</li>
<li>Fixed delete variable from Test Suite settings remaining in Project Explorer.</li>
<li>Added <b>caret style</b> to change insert caret to 'block' or 'line' in Text Editor, by editing
Expand Down Expand Up @@ -323,7 +325,7 @@ def set_content(self, html_win, content):
<pre class="literal-block">
python -m robotide.postinstall -install
</pre>
<p>RIDE {VERSION} was released on 11/August/2024.</p>
<p>RIDE {VERSION} was released on 15/August/2024.</p>
<!-- <br/>
<h3>May The Fourth Be With You!</h3>
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>
Expand Down
1 change: 1 addition & 0 deletions src/robotide/lib/compat/parsing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@

from .validator import ErrorReporter
from .language import get_english_label, get_localized_setting
from .languages import *
26 changes: 19 additions & 7 deletions src/robotide/lib/compat/parsing/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
except ImportError as e:
sys.stderr.write(f"Trying to import robot's languages module returned error: {repr(e)}\n")
sys.stderr.write("You need to have Robot Framework v6.0 or newer to use languages in test suites.\n")
Language = None
try:
# Using local copy of https://github.com/robotframework/robotframework/blob/v7.0.1/src/robot/conf/languages.py
from .languages import Language
except ImportError:
Language = None
from robot.errors import DataError
from robotide.lib.robot.utils import Utf8Reader

Expand All @@ -43,7 +47,10 @@ def check_file_language(path):
from robot.conf.languages import Languages
except ImportError as err:
sys.stderr.write(f"Trying to import robot's languages module returned error: {repr(err)}\n")
return None
try:
from .languages import Languages
except ImportError:
return None
try:
build_lang = Languages(language_string, add_english=False)
except (DataError, ModuleNotFoundError) as err:
Expand Down Expand Up @@ -73,7 +80,10 @@ def get_language_name(lang_code):
from robot.conf.languages import Languages
except ImportError as err:
sys.stderr.write(f"Trying to import robot's languages module returned error: {repr(err)}\n")
return None
try:
from .languages import Languages
except ImportError:
return None
try:
build_lang = Languages(lang_code.replace('_', '-'), add_english=False)
except (DataError, ModuleNotFoundError) as err:
Expand Down Expand Up @@ -123,7 +133,7 @@ def get_headers_for(language, tables_headers, lowercase=True):
try:
if not mlang:
mlang = 'en'
lang = Language.from_name(mlang.replace('_','-'))
lang = Language.from_name(mlang.replace('_', '-'))
languages.add(lang)
except ValueError:
print(f"DEBUG: language.py get_headers_for Exception at language={mlang}")
Expand All @@ -146,7 +156,8 @@ def get_headers_for(language, tables_headers, lowercase=True):
header = list(headers.keys())[inx].lower() if lowercase else list(headers.keys())[inx]
build_headings.append(header)
break
except Exception as e:
except Exception as ex:
print(f"DEBUG: robotide.lib.compat.parsing.language.py get_headers: {ex}")
pass
inx += 1
for bh in build_headings:
Expand Down Expand Up @@ -203,7 +214,8 @@ def get_settings_for(language, settings_names):
setting = list(settings.keys())[inx]
build_table[setting] = item
break
except Exception as e:
except Exception as ex:
print(f"DEBUG: robotide.lib.compat.parsing.language.py get_settings: {ex}")
pass
inx += 1
# print(f"DEBUG: language.py get_settings_for RETURN build_table={build_table}")
Expand All @@ -223,7 +235,7 @@ def get_english_label(lang, label):
except ValueError:
print(f"DEBUG: language.py get_english_label Exception at language={lang}")
else:
mlang = Language.from_name(lang.replace('_','-'))
mlang = Language.from_name(lang.replace('_', '-'))
if not mlang:
print(f"DEBUG: language.py get_english_label lang={lang} not found")
return None
Expand Down
Loading
Loading