Giter Club home page Giter Club logo

resx-editor's Introduction

VS Marketplace Badge

RESX Editor

This is a previewer/light-weight editor for string-based RESX/RESW files commonly used for localization for .NET applications. As with most of my projects this started as a learning experiment and thus is not feature rich. But it is MIT licensed, so please, by all means contribute!

Features

Pretty simple really, if you open a .resx/.resw file from your workspace, you have the option of using this by default for the viewer and it will show the contents in a data grid format:

2023-06-22_13-55-08

Edit a resource

To edit, simple click in a cell and start typing. This will 'dirty' the file and you'll have to save (doesn't auto-persist).

Add a new resource

To add a new resource, open the resx file you want to add it to and launch the command pallette (CTRL + SHIFT + P). Choose ResX: Add new resource which will launch a flow to ask you for the Key, Value, and Comment (all required) and then add it to the active document. add-resource

Delete a resource

From an open resx file, right-click on the resource you want to delete and choose Delete resource from the context menu. delete-resource

Logging

In the settings you can enable 'verbose' logging which will create an output window category and you can see some details. Helpful for troubleshooting. logging

A note on editing...

Right now this is a bulk edit -- meaning it will re-serialize the data in/out of JSON/RESX format for this editor. Tracking issue #1 for improvements here, but as of now 'works on my machine' applies. The serialization also probably will not match your line endings/spacing so a first diff might be more red/green than expected. If that doesn't work, help fix or just probably not use this.

VS Code Git diff viewing

Because this is a custom editor, if it is set as default, when viewing a diff it will render both editor views and you won't be able to see the actual diff. You'll want to switch to the Text Editor to see it. This is a known limitation of the VS Code custom editor extensbility points microsoft/vscode#138525 right now. Maybe there is a better way of doing this even in this mode, if you can think of one, please contribute to #3.

Disabling the editor

To disable this right click on a resx or resw file and choose Open with... and change options: image

Credit

This is not an original idea of course. ResX/ResW/XML editors exist. None of them use the VS Code WebView UI toolkit and why I did this one. Again, selfish reasons, and a learning point. There are a few others out there that are similar and inspiration was absolutely from those. Also the editing was contributed by @worksofliam as we wait to see if the vscode-data-grid itself can get default edibility.

resx-editor's People

Contributors

timheuer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jassmith

resx-editor's Issues

Support for newlines inside of a field

I'm not sure if this is common among applications that use RESX, but the one I do respects newlines entered into a field.

If would be very useful to be able to use shift + enter / alt + enter to add a newline to a field and have the row scale to accomodate the additional line(s). Right now I generally have to edit the resx XML directly. In XML, the newlines are not marked by \n, they are just plain on a new line.

I realize this may be a bit of a rare use case, but wanted to ask just in case.

Sorting RESX display by column alphabetically

Hi. Love the extension so far - it looks very nice and clean!

One thing I would love to be able to do in it is clicking on the headers (once) to sort the RESX entries A to Z by the contents of that column, and click another time to reverse the sorting.

I often find that I enter new strings haphazardly as I need them, so being able to sort them would help with my ability to keep an overview a lot.

Align with file format

Hi! I've noticed that when adding a new resource and then saving it, the file is automatically formatted (some spaces are removed and also <comment/> tags are added to every resource I didn't change). It would've been nice if the formatting didn't get in the way 🙂

(The .resx files were created using VS 2022)

Handle diff view

When a git diff is in play the editor doesn’t help. Known issue with Vs code

Better keyboard navigation

If you ask me, using arrow keys for cell navigation is not a good design. I'm very used to using them for text manipulation in an edit field (along with the Shift and Ctrl modifiers), which I can't do with the extension. Hotkeys like Alt + left/right arrows for navigating to the previous/next cell and, most importantly, Alt + up/down arrows for the previous/next row in a column would make a world of a difference for localizing. An additional alternative hotkey like Tab / Shift + Tab for the next/previous cell would also be good.

Also, very important: switching to a new cell should make the cell editable by default without hitting Enter. It speeds up the localization process by a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.