File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ public List<BaseTask> SystemTasks()
292
292
293
293
public String PathLocalisation ( string path )
294
294
{
295
- var meta = repo . GetPuckMeta ( ) . Where ( x => x . Name == DBNames . PathToLocale && path . StartsWith ( x . Key ) ) . OrderByDescending ( x => x . Key . Length ) . FirstOrDefault ( ) ;
295
+ var meta = repo . GetPuckMeta ( ) . Where ( x => x . Name == DBNames . PathToLocale && ( path + "/" ) . StartsWith ( x . Key + "/" ) ) . OrderByDescending ( x => x . Key . Length ) . FirstOrDefault ( ) ;
296
296
return meta == null ? null : meta . Value ;
297
297
}
298
298
public String DomainMapping ( string path )
Original file line number Diff line number Diff line change @@ -329,12 +329,17 @@ public static void UpdatePathLocaleMappings(bool addInstruction=false)
329
329
using ( var scope = PuckCache . ServiceProvider . CreateScope ( ) )
330
330
{
331
331
var repo = scope . ServiceProvider . GetService < I_Puck_Repository > ( ) ;
332
- var meta = repo . GetPuckMeta ( ) . Where ( x => x . Name == DBNames . PathToLocale ) . OrderByDescending ( x => x . Key . Length ) . ToList ( ) ;
332
+ var meta = repo . GetPuckMeta ( )
333
+ . Where ( x => x . Name == DBNames . PathToLocale )
334
+ . ToList ( )
335
+ . Where ( x=> ! string . IsNullOrEmpty ( x . Key ) )
336
+ . OrderByDescending ( x => x . Key . Count ( xx => xx == '/' ) )
337
+ . ToList ( ) ;
338
+
333
339
var map = new Dictionary < string , string > ( ) ;
334
340
meta . ForEach ( x =>
335
341
{
336
- //map.Add(x.Key.ToLower(), x.Value.ToLower());
337
- map [ x . Key . ToLower ( ) ] = x . Value . ToLower ( ) ;
342
+ map [ x . Key . ToLower ( ) ] = x . Value . ToLower ( ) ;
338
343
} ) ;
339
344
PuckCache . PathToLocale = map ;
340
345
You can’t perform that action at this time.
0 commit comments