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

Add support for localized test suites and UI #2678

Merged
merged 60 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
f3af58f
Improve reader. DEBUG
HelioGuilherme66 Oct 28, 2023
11c3a16
Improve reader.
HelioGuilherme66 Oct 28, 2023
d42db56
Add check_file_language. Working in project.load_data, but not when o…
HelioGuilherme66 Nov 2, 2023
87a1b41
Add condition fro lang in model
HelioGuilherme66 Nov 4, 2023
9e3b838
First success opening laang_pt and lang_fr tests
HelioGuilherme66 Nov 4, 2023
9b6752e
Make unit tests pass
HelioGuilherme66 Nov 5, 2023
1df4637
Improve lang headers, pt and fr
HelioGuilherme66 Nov 5, 2023
7c9a599
Add unit tests. All lnguages tests can be opened. Missing lib lang fixes
HelioGuilherme66 Nov 6, 2023
1321614
Identify where language can be checked from TextEditor
HelioGuilherme66 Nov 8, 2023
ab61544
More tables using language
HelioGuilherme66 Nov 10, 2023
a54faac
Working opening with lang set. Tests for multiple langs
HelioGuilherme66 Nov 11, 2023
b8c600c
Working opening directories with different lang files
HelioGuilherme66 Nov 11, 2023
bb5a0e0
Make __init__.robot open with language set. WIP, copy _aliases to _se…
HelioGuilherme66 Nov 12, 2023
626f33b
OK Opens from directories.
HelioGuilherme66 Nov 12, 2023
7b7d9ae
Fixed open test suites directories. Need utests and fix comments
HelioGuilherme66 Nov 19, 2023
56ccf5e
Fix opening directly __init__.robot
HelioGuilherme66 Nov 19, 2023
aa0d0dd
Cleanup code
HelioGuilherme66 Nov 20, 2023
76aea2d
Improve opening of Resource files
HelioGuilherme66 Nov 22, 2023
ece1962
Open pt folder, fail en folder. Failed comment blocks at formatter level
HelioGuilherme66 Nov 27, 2023
d97877f
Add order of sections. Still broken en directories, and missing memor…
HelioGuilherme66 Nov 28, 2023
cb10ed3
Fix some utests
HelioGuilherme66 Nov 29, 2023
ff34cbf
Fix unit tests
HelioGuilherme66 Nov 29, 2023
db08db5
Remove inner comments from the en test directory
HelioGuilherme66 Nov 30, 2023
1e9ba61
Success in multiple Comments sections. Missing isolated comments
HelioGuilherme66 Dec 3, 2023
f7fc319
Fix # isolated comments and Comments section
HelioGuilherme66 Dec 3, 2023
f8a14b9
Settings Dialogs OK. Need localizaation. Variables is debug
HelioGuilherme66 Dec 4, 2023
ae5e17b
Adjust buttons in table settings to open dialogs for Tests and Tasks
HelioGuilherme66 Dec 5, 2023
a02eaae
Fix all settings Edit buttons
HelioGuilherme66 Dec 6, 2023
7269ef9
Fix continuation lines in Documentation other than En
HelioGuilherme66 Dec 9, 2023
0c1d8b5
Improve setting of language in TextEditor
HelioGuilherme66 Dec 9, 2023
18054e6
Fix Library translated labels
HelioGuilherme66 Dec 10, 2023
5d40dcc
I18n colorization (#143)
HelioGuilherme66 Dec 18, 2023
f6797ad
Update docs and version
HelioGuilherme66 Dec 19, 2023
b9eb911
Add validator from RF 6.1.1 to Text Edit. WIP fails to save language …
HelioGuilherme66 Dec 20, 2023
8ae1481
Add new validator
HelioGuilherme66 Dec 20, 2023
8747a6e
Fix saving modified files with language setting
HelioGuilherme66 Dec 21, 2023
d933588
Fix help dialog for Pygments
HelioGuilherme66 Dec 21, 2023
22a6e05
Add protection to shared_memory language setting
HelioGuilherme66 Dec 21, 2023
bfde383
Remove extra spaces from lines in Comments sections
HelioGuilherme66 Dec 21, 2023
2ea89c5
Remove support for HTML test files. WIP
HelioGuilherme66 Dec 22, 2023
d769da0
Make own pygments a module
HelioGuilherme66 Dec 22, 2023
ba08cf3
Fix broken sincronization of changes in Text Editor
HelioGuilherme66 Dec 23, 2023
71051c6
Add minimal protection to RF lower than 6.0
HelioGuilherme66 Dec 24, 2023
de08273
Add tooltip to settings fields localized names
HelioGuilherme66 Dec 24, 2023
1323a5b
Notes about tooltips
HelioGuilherme66 Dec 24, 2023
168d520
Add language selector to Preferences->General
HelioGuilherme66 Dec 24, 2023
fa9a893
Initial structure for localization change
HelioGuilherme66 Dec 25, 2023
15869c4
Add first example de localized strings
HelioGuilherme66 Dec 26, 2023
cdf596f
Add test from W2
HelioGuilherme66 Dec 27, 2023
41cc955
Add more debugging for localization
HelioGuilherme66 Dec 30, 2023
373db2d
Fix pause translated commands
HelioGuilherme66 Dec 30, 2023
e10b9fb
Update translations for TestRunner
HelioGuilherme66 Dec 30, 2023
28eaa76
Fix some unit tests
HelioGuilherme66 Dec 30, 2023
610cf81
Fix import failed XML
HelioGuilherme66 Dec 30, 2023
b3ccf0b
Fix unit test
HelioGuilherme66 Dec 30, 2023
59b95bd
Fix more translations in in Tests and in Unudrd Keywords
HelioGuilherme66 Dec 31, 2023
d59f803
Fix default ui language, Variables and Metadata editors
HelioGuilherme66 Dec 31, 2023
7eeaef5
Improvement in language save or RIDE start
HelioGuilherme66 Dec 31, 2023
d6c4333
Add pt_BR translation
HelioGuilherme66 Jan 1, 2024
85d4313
DEBUG Save from Text Editor
HelioGuilherme66 Jan 1, 2024
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
10 changes: 10 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni

== https://github.com/robotframework/RIDE[Unreleased]

=== Added

- Added support for language configured test suites, with installed Robot Framework version 6.0 or higher.
- Fields are shown in the language of the files in Grid Editor (will be configurable if future versions).
- Tooltips for the fields are always shown in English.
- Colorization for language configured files is working in Text Editor.

=== Fixed

- Fixed New User Keyword dialog not allowing empty Arguments field

=== Removed

- Removed support for old Python versions, 3.6 nd 3.7.

== https://github.com/robotframework/RIDE/blob/master/doc/releasenotes/ride-2.0.8.1.rst[2.0.8.1] - 2023-11-01

Expand Down
6 changes: 4 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ If you are looking for the latest released version, you can get the source code

See the https://github.com/robotframework/RIDE/blob/master/doc/releasenotes/ride-2.0.8.1.rst[release notes] for latest release version 2.0.8.1

**Version https://github.com/robotframework/RIDE/tree/release/2.0.8.1[2.0.8.1] was the last release supporting Python 3.6 and 3.7**

**Version https://github.com/robotframework/RIDE/tree/release/1.7.4.2[1.7.4.2] was the last release supporting Python 2.7**


**The current development version is based on 2.0.8.1, supports Python from 3.6 up to 3.11 (1st November 2023).**
**The current development version is based on 2.0.8.1, supports Python from 3.8 up to 3.11 (20th December 2023).**

Currently the unit tests are tested on Python 3.10, and 3.11 (which is the recommended version).
Likewise, the current version of wxPython, is 4.2.1, but RIDE is known to work with 4.0.7 and 4.1.1 versions.
Expand All @@ -32,7 +34,7 @@ Likewise, the current version of wxPython, is 4.2.1, but RIDE is known to work w

`pip install -U robotframework-ride`

Install current development version (**2.0.9dev#**) with:
(3.8 < python <= 3.11) Install current development version (**2.1a1**) with:

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

Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
Development Status :: 5 - Production/Stable
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Expand Down Expand Up @@ -94,7 +92,7 @@ def run(self):
package_dir={'': SOURCE_DIR},
packages=find_packages(SOURCE_DIR),
package_data=PACKAGE_DATA,
python_requires='>=3.6',
python_requires='>=3.8, <3.12',
# Robot Framework package data is not included, but RIDE does not need it.
# Always install everything, since we may be switching between versions
options={'install': {'force': True}},
Expand Down
39 changes: 28 additions & 11 deletions src/robotide/action/actioninfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import builtins
import re

import wx

from ..widgets import ImageProvider
from .shortcut import Shortcut

_ = wx.GetTranslation # To keep linter/code analyser happy
builtins.__dict__['_'] = wx.GetTranslation

def action_info_collection(data, event_handler, container=None):

def action_info_collection(data, event_handler, data_nt=None, container=None):
"""Parses the ``data`` into a list of `ActionInfo` and `SeparatorInfo` objects.

The data is parsed based on the simple DSL documented below.
Expand All @@ -32,6 +36,9 @@ def action_info_collection(data, event_handler, container=None):
event_handler
The event handler that implements the actions. See `finding handlers`_
for more information.
data_nt
Since RIDE 2.1, this is the original English menudata, or None which will be a copy of data
This is due to the way menu is created for translations, which will not build the correct handler names.
container
the wxPython element containing the UI components associated with
the `ActionInfo`.
Expand Down Expand Up @@ -91,7 +98,7 @@ def action_info_collection(data, event_handler, container=None):
Specifying container
--------------------

By default the given ``container`` is passed to the `ActionInfo.__init__`
By default, the given ``container`` is passed to the `ActionInfo.__init__`
method directly. This can be altered by prefixing the ``name`` with an
exclamation mark (e.g. ``!Save`` or ``!My Action``) to make that action
global. With these actions the container given to the `ActionInfo.__init__`
Expand All @@ -114,30 +121,41 @@ def action_info_collection(data, event_handler, container=None):
Content Assist (Ctrl-Space or Ctrl-Alt-Space) | Has two shortcuts.
"""

if not data_nt:
data_nt = data
menu = None
actions = []
for row in data.splitlines():
for row, row_nt in zip(data.splitlines(), data_nt.splitlines()):
row = row.strip()
if not row:
row_nt = row_nt.strip()
print(f"DEBUG: actioninfo.py action_info_collection in loop row={row}\noriginal={row_nt} ")
if not row and not row_nt:
continue
elif row.startswith('[') and row.endswith(']'):
menu = row[1:-1].strip()
# print(f"DEBUG: actioninfo.py action_info_collection menu={menu}")
else:
actions.append(_create_action_info(event_handler, menu, container, row))
actions.append(_create_action_info(event_handler, menu, container, row, row_nt))
return actions


def _create_action_info(eventhandler, menu, container, row):
def _create_action_info(eventhandler, menu, container, row, row_nt):
if row.startswith('---'):
return SeparatorInfo(menu)
tokens = [t.strip() for t in row.split('|')]
tokens += [''] * (5-len(tokens))
name, doc, shortcut, icon, position = tokens
if name.startswith('!'):
tokens_nt = [t.strip() for t in row_nt.split('|')]
tokens_nt += [''] * (5-len(tokens_nt))
name_nt, __, __, __, __ = tokens_nt
if name_nt.startswith('!'):
name = name[1:]
name_nt = name_nt[1:]
container = None
eventhandler_name, name = get_eventhandler_name_and_parsed_name(name)
eventhandler_name, name_nt = get_eventhandler_name_and_parsed_name(name_nt)
action = getattr(eventhandler, eventhandler_name)
print(f"DEBUG: actioninfo.py _create_action_info menu={menu} eventhandler_name={eventhandler_name},"
f" name_nt={name_nt}")
return ActionInfo(menu, name, action, container, shortcut, icon, doc, position)


Expand All @@ -152,8 +170,7 @@ def _parse_shortcuts_from_name(name):
eventhandler_name, shortcuts = name.split('(', 1)
shortcuts = shortcuts.split(')')[0]
elements = shortcuts.split(' or ')
name = '%s (%s)' % (eventhandler_name, ' or '.join(Shortcut(e).printable for e in
elements))
name = '%s (%s)' % (eventhandler_name, ' or '.join(Shortcut(e).printable for e in elements))
return eventhandler_name, name
return name, name

Expand Down Expand Up @@ -187,7 +204,7 @@ class ActionInfo(MenuInfo):

def __init__(self, menu_name, name, action=None, container=None,
shortcut=None, icon=None, doc='', position=-1):
"""Initializes information needed to create actions..
"""Initializes information needed to create actions...

:Parameters:
menu_name
Expand Down
Loading
Loading