Git Product home page Git Product logo

localisation's People

Contributors

azure-pipelines[bot] avatar chrissainty avatar franklin89 avatar mattgenious avatar paul-schroeder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

localisation's Issues

JS not published to expected location

When I publish my CSB app, just using the VS publish wizard on my project and publishing to a folder, the 'Blazored.Localisation' folder ends up under 'bin\Release\netstandard2.0\publish\wwwroot\_content' which seems kind of logical based on the publish profile but I was expecting it to end up in 'bin\Release\netstandard2.0\publish<app-name>\dist\_content' along with everything else that I can just copy to my hosting location.

The other library js files that I'm using end up under the dist folder, so I was wondering why this library was different, resulting in me having to remember to copy the files separately.

My publish profile looks like this:

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <PublishProvider>FileSystem</PublishProvider>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <ProjectGuid>da48448a-b9da-483f-81c1-81c882f5f773</ProjectGuid>
    <publishUrl>bin\Release\netstandard2.0\publish\</publishUrl>
    <DeleteExistingFiles>True</DeleteExistingFiles>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>
</Project>

Localization vs Localisation

For wiring up Blazored.Localisation in Program.cs there is:
builder.Services.AddBlazoredLocalisation();

And

host.InitializeBlazoredLocalization();

localisation (British English) vs localization (American English). Shouldn't we pick one?

Culture is being reset after state gets changed

Hi,

I am using this approach for setting the culture in my blazor app. I have a DateTime property that is bound to an input field. The initial load is with the correct Culture. If I then change the value of the input field the Culture gets reset to the default culture and the date is formatted incorrectly.

Any idea how to solve that?

Language setting

Is it possible to modify the library to make the language selectable inside the app? Relying on browser culture is not always the best way.

BrowserDateTimeProvider.GetInstance fails under some circumstances

It is possible to make BrowserDateTimeProvider.GetInstance fail and the culprit seems to be the call to getTimezoneOffset. It has never done this with normal usage but I can lay out the way to do it consistently.

I started using Serilog on the client (you can follow the instructions here) https://github.com/serilog/serilog/wiki/Getting-Started And note the call to the logger made in Program.cs Log.Information("Hello, world!"); With that present the call to GetInstance (above) throws an exception. I comment that out and it works normally.

I have a work-around I wrap
timeZoneOffSet = await _jsRuntime.InvokeAsync("eval", "new Date().getTimezoneOffset()");
in a try/catch and upon failure simply call it again. The second call succeeds.

I don't understand how the two could be interacting but something is up. I used your repo as is and upgraded to Core 3.1 with the same results.

DefaultThreadCurrentCulture

ultureInfo.DefaultThreadCurrentCulture = culture;

This actually changes the culture for all users that have some blazor page already open.

[Question] blazor 3.2 preview 1

In this line: host.InitializeBlazoredLocalization();
I am getting this error:

'WebAssemblyHost' does not contain a definition for 'InitializeBlazoredLocalization' and no accessible extension method 'InitializeBlazoredLocalization' accepting a first argument of type 'WebAssemblyHost' could be found (are you missing a using directive or an assembly reference?)

I am using your settings but I have this error. Do you have any idea why?

.NetStandard 2.1

The latest version of Blazor is causing an issue. I updated the libraries, changed the target to 2.1 and tried to run the demo.

WASM: System.AggregateException: One or more errors occurred. (Could not find 'blazoredLocalisation' in 'window'.blazor.webassembly.js:1
WASM: Error: Could not find 'blazoredLocalisation' in 'window'.

Per our conversation a script tag is now required and adding the following fixes everything.
<script src="_content/Blazored.Localisation/blazored-localisation.js"></script>

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.