Comments (2)
Dave,
First off, I appreciate that you chose to give wcDocker a try!
The panel titles and ID's are actually separate. It's just that when I
initialize a panel by default, I take the ID you gave it and graft it to
the title as well. Inside the create function of a panel, though, you can
change the title with myPanel.title("some new title"), which will not
effect the ID.
So, ideally, you would not localize the registered name of each panel
(their ID), you would only localize the title that appears once a panel is
created.
Unfortunately, that does not fix the fact that you still see the ID text in
the popup menu when right clicking to create new panels. To fix that, I
have just updated the code to allow you to specify the displayed title text
for the panel when registering it. This title text is independent of the
panel id, so you should be able to localize it. Your code should look like
this:
myDocker.registerPanelType('panelId', {
title: 'LocalizedTitle',
onCreate: function(...
});
Any time you change the language, you would need to change the title option
for each panel type and then save and restore the layout to refresh all
existing panels with their new titles.
myDocker.panelTypeInfo('panelId').title = 'newLocalizedTitle';
I hope this helps you out, let me know if you have any other suggestions.
- Lochemage
On Fri, Feb 27, 2015 at 7:33 AM, Dave Page [email protected] wrote:
My app uses the Python Flask framework on the backend, with Flask-Babel to
provide localisation for the Python code and HTML/JS. I cannot seem to
figure out a reliable way of localising panel titles however, largely due
to the fact that they're stored in the panel layout and thus get restored
along with the layout when a user re-runs the app. That's fine if they're
using the same language as before, but not if they've switched (perhaps
because they're using a different browser).It seems to me that an ID should be used when registering panels and when
saving/restoring the layout, so that I can re-assign the panel titles in
the correct language to the appropriate panels based on the ID. The ID
would then be stored in the layout data and be the primary identifier for
the panels, thus allowing the titles to be arbitrarily changed.Is there a way to achieve this that I'm missing?
—
Reply to this email directly or view it on GitHub
#26.
from wcdocker.
That seems to work nicely - many thanks!
from wcdocker.
Related Issues (20)
- does wcDocker have a destroy-function? HOT 8
- Can wcDocker "just" restore the positions/dims of panels without re-instantiation? HOT 5
- Using 'Panel Creation Elements' breaks creation of panels via context menu
- Docker panel resize HOT 1
- Docker is in infinite loop HOT 2
- Cannot move the stacked Iframe panel into the browser tab. HOT 1
- mobile device events
- Embedded wcDocker instance or otherwise constraining panels to one layout HOT 3
- Can I use wcDocker with angular2? HOT 2
- Provide dynamic options via addPanel HOT 3
- Improved forked version available - bug fixes and performance
- PopOut Browser
- restoring a layout refreshes iframes HOT 1
- Scroll position resets after resize panel HOT 1
- Using moveable(false) causes Browser window hang HOT 5
- wcDocker Frame do not load URL when we use jQuery v.3.3.1
- Any light Theme?
- How do I prevent a panel from resizing?
- Is it possible to localize the context menu?
- Localization
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wcdocker.