GithubHelp home page GithubHelp logo

lantzify / auto-dictionaries Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 9.89 MB

Auto dictionaries is a Umbraco package that finds static content in templates and replaces them with dictionary items.

License: MIT License

C# 3.06% JavaScript 82.98% HTML 5.96% CSS 8.00%
umbraco-v8 umbraco umbraco-package umbraco-backoffice umbraco-packages umbraco-v9 umbraco-v10 umbraco-v11 umbraco-v12

auto-dictionaries's Introduction

Auto dictionaries

Auto dictionaries is a Umbraco package that finds static content in templates and replaces them with dictionary items.

version Nuget Umbraco

About

Auto dictionaries is a Umbraco package made for v8+. Made to help automate the process of replacing static content in templates with dictionary items. It can be found on the under the "Translation" section and is an admin only tool. Not visible for user group "editors".

preview

Installation

You can install Auto dictionaries via Nuget

PM> dotnet add package AutoDictionaries

Contributing

If you would like to help me improve this package, feel free to create a pull request!

Login details:

Issues

If you find any issues with the package feel free to raise a issue!

Screenshots

preview

preview

preview

auto-dictionaries's People

Contributors

lantzify avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

jannikanker

auto-dictionaries's Issues

Dot dot dot end of text

Describe the bug
Having a dot at the end of static content, dosen't get registerd as static content.

LINQ statement in view

Having eg
var selection = siteSection.Children.Where(x => x.IsVisible());
Then
x.IsVisible
Gets picked up as static content

Build targets file contains invalid command in ClearautoDictionariesAssets

Describe the bug
After installing this package, doing a Clean causes an error because the targets file seems to contain an invalid command (<ReautoDir Directories="@(autoDictionariesDir)" />, which should be <RemoveDir />).

To Reproduce
Steps to reproduce the behavior:

  1. Clean project/solution with AutoDictionaries installed

Expected behavior
No error when doing a Clean and the App_Plugins files being removed.

Additional context
Although I see the build target files are included in the project file, I can't find them in the repository:

<!-- target file to copy app_plugins in .netcore -->
<None Include="build\**\*.*">
<Pack>True</Pack>
<PackagePath>buildTransitive</PackagePath>
</None>

However, you can inspect the contents of this file and spot the above typo if you open the NuGet file (or go to https://nuget.info/packages/AutoDictionaries/10.0.1).

Fintune Regex for finding static content

The Regex for finding content still has some work to do. My solution works, but it feels a bit janky.

var staticContents = Regex.Matches(viewContent, @"(?<!(=>))(?<=>)(?![.,])([\s\w,.&?!'#\(]+)(.*?)")
                            .Cast<Match>()
                            .Where(x => !string.IsNullOrWhiteSpace(x.Value) && 
                                                 Regex.Match(x.Value, @"\D+").Length > 1 &&
                                                !Regex.IsMatch(x.Value, @"(if *\()"))
                             .Select(m => m.Value.Trim())
                             .ToList();

There are so many combinations on how static content is placed in views. Would like to come up a new solution to find static content that is a bit more robust and more fool proof.

In addition. It would be nice if it could:

  • Skip commented static content

Partial view infinite editor

Would be nice to be able to open partial view in a infinite editor to double check the view for static content.

Will need to build my own nice Umbraco only supports infinite editor for templates.

Search

Search for views on the overview page. Top right position

Paginator

Is your feature request related to a problem? Please describe.
Loading time becomes an issue when having a large amout of partial views & templates.

Describe the solution you'd like
A paginator would be solid here

Pathing

Is your feature request related to a problem? Please describe.
Having multiple views with same name. Like Umbraco forms uses. Makes the overview view a bit confusing.

Describe the solution you'd like
Display the path in both edit & overview view

Add support for partial views

Is your feature request related to a problem? Please describe.
While using this package. I have come across static content in partial views more and more.

Describe the solution you'd like
Split the IAutoDictionariesService into templates & partial views servicxe . Partial views are a bit harder to access than templates.

For the dashboard. Add a new header of type wich will contain if it's a template or partial view

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.